Merge pull request #765 from wolfman2000/wolf-cmake-feature-detection
Use proper cmake detection of features.
This commit is contained in:
@@ -55,3 +55,4 @@ function(disable_project_warnings projectName)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
# Prep options that are needed for each platform.
|
||||
|
||||
# This option allows for networking support with StepMania.
|
||||
option(WITH_NETWORKING "Build with networking support." ON)
|
||||
|
||||
# This option allows for additional version information to be built-in.
|
||||
option(WITH_VERSION_INFO "Build with version information." ON)
|
||||
|
||||
# This option quiets warnings that are a part of external projects.
|
||||
option(WITH_EXTERNAL_WARNINGS "Build with warnings for all components, not just StepMania." OFF)
|
||||
|
||||
|
||||
+60
-7
@@ -45,8 +45,67 @@ include("${CMAKE_CURRENT_LIST_DIR}/CMake/SMDefs.cmake")
|
||||
# Put the predefined targets in separate groups.
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# Checks the standard include directories for c-style headers.
|
||||
# We may use C++ in this project, but the check works better with plain C headers.
|
||||
include(CheckIncludeFiles)
|
||||
check_include_files(math.h HAVE_MATH_H)
|
||||
check_include_files(alloca.h HAVE_ALLOCA_H)
|
||||
check_include_files(dirent.h HAVE_DIRENT_H)
|
||||
check_include_files(inttypes.h HAVE_INTTYPES_H)
|
||||
check_include_files(stdint.h HAVE_STDINT_H)
|
||||
check_include_files(endian.h HAVE_ENDIAN_H)
|
||||
check_include_files(sys/endian.h HAVE_SYS_ENDIAN_H)
|
||||
check_include_files(machine/endian.h HAVE_MACHINE_ENDIAN_H)
|
||||
check_include_files(sys/param.h HAVE_SYS_PARAM_H)
|
||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files(fcntl.h HAVE_FCNTL_H)
|
||||
check_include_files(unistd.h HAVE_UNISTD_H)
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckCXXSymbolExists)
|
||||
if (WIN32 AND MSVC)
|
||||
check_function_exists(_mkdir HAVE__MKDIR)
|
||||
check_function_exists(_snprintf HAVE__SNPRINTF)
|
||||
else()
|
||||
check_function_exists(mkdir HAVE_MKDIR)
|
||||
check_function_exists(snprintf HAVE_SNPRINTF)
|
||||
endif()
|
||||
check_cxx_symbol_exists(powf cmath HAVE_POWF)
|
||||
check_cxx_symbol_exists(sqrtf cmath HAVE_SQRTF)
|
||||
check_cxx_symbol_exists(sinf cmath HAVE_SINF)
|
||||
check_cxx_symbol_exists(tanf cmath HAVE_TANF)
|
||||
check_cxx_symbol_exists(cosf cmath HAVE_COSF)
|
||||
check_cxx_symbol_exists(acosf cmath HAVE_ACOSF)
|
||||
check_cxx_symbol_exists(truncf cmath HAVE_TRUNCF)
|
||||
check_cxx_symbol_exists(roundf cmath HAVE_ROUNDF)
|
||||
check_cxx_symbol_exists(lrintf cmath HAVE_LRINTF)
|
||||
check_cxx_symbol_exists(strtof cstdlib HAVE_STRTOF)
|
||||
check_symbol_exists(M_PI math.h HAVE_M_PI)
|
||||
|
||||
# Checks to make it easier to work with 32-bit/64-bit builds if required.
|
||||
include(CheckTypeSize)
|
||||
check_type_size(intptr_t SIZEOF_INTPTR_T)
|
||||
check_type_size(pid_t SIZEOF_PID_T)
|
||||
check_type_size(size_t SIZEOF_SIZE_T)
|
||||
check_type_size(ssize_t SIZEOF_SSIZE_T)
|
||||
|
||||
include(TestBigEndian)
|
||||
test_big_endian(BIGENDIAN)
|
||||
if (${BIGENDIAN})
|
||||
set(ENDIAN_BIG 1)
|
||||
else()
|
||||
set(ENDIAN_LITTLE 1)
|
||||
endif()
|
||||
|
||||
if (WITH_VERSION_INFO)
|
||||
set(HAVE_VERSION_INFO 1)
|
||||
endif()
|
||||
|
||||
configure_file("${SM_SRC_DIR}/config.in.hpp" "${SM_SRC_DIR}/generated/config.hpp")
|
||||
|
||||
# Dependencies go here.
|
||||
set(ENDIANNESS "ENDIAN_LITTLE")
|
||||
|
||||
if(WIN32)
|
||||
set(HAS_OGG TRUE)
|
||||
set(HAS_MP3 TRUE)
|
||||
@@ -114,7 +173,6 @@ elseif(MACOSX)
|
||||
MAC_FRAME_QUICKTIME
|
||||
)
|
||||
elseif(LINUX)
|
||||
include(TestBigEndian)
|
||||
include(ExternalProject)
|
||||
|
||||
if(NOT WITH_GPL_LIBS)
|
||||
@@ -321,11 +379,6 @@ elseif(LINUX)
|
||||
message(FATAL_ERROR "GLEW required to compile StepMania.")
|
||||
endif()
|
||||
|
||||
test_big_endian(BIGENDIAN)
|
||||
if (${BIGENDIAN})
|
||||
set(ENDIANNESS "ENDIAN_BIG")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# Define installer based items for cpack.
|
||||
|
||||
@@ -7,7 +7,6 @@ add_library("GtkModule"
|
||||
"arch/LoadingWindow/LoadingWindow_GtkModule.cpp"
|
||||
"arch/LoadingWindow/LoadingWindow_GtkModule.h"
|
||||
)
|
||||
sm_add_compile_definition("GtkModule" "${ENDIANNESS}")
|
||||
|
||||
# It is normally not appropriate to set the prefix to the empty string.
|
||||
# This is to maintain compatibility with the current source.
|
||||
@@ -23,7 +22,11 @@ target_link_libraries("GtkModule" ${GTK2_LIBRARIES})
|
||||
set_property(TARGET "GtkModule" PROPERTY FOLDER "Internal Libraries")
|
||||
list(APPEND SM_GTK_INCLUDE_DIRS
|
||||
"${SM_SRC_DIR}"
|
||||
"${SM_SRC_DIR}/generated"
|
||||
"${SM_SRC_DIR}/arch/LoadingWindow"
|
||||
"${GTK2_INCLUDE_DIRS}"
|
||||
)
|
||||
|
||||
sm_add_compile_definition("GtkModule" CMAKE_POWERED)
|
||||
|
||||
target_include_directories("GtkModule" PUBLIC ${SM_GTK_INCLUDE_DIRS})
|
||||
|
||||
+6
-2
@@ -38,6 +38,7 @@ list(APPEND SMDATA_GLOBAL_FILES_SRC
|
||||
)
|
||||
|
||||
list(APPEND SMDATA_GLOBAL_FILES_HPP
|
||||
"generated/config.hpp"
|
||||
"GameLoop.h"
|
||||
"global.h"
|
||||
"ProductInfo.h" # TODO: Have this be auto-generated.
|
||||
@@ -204,6 +205,10 @@ set_target_properties("${SM_EXE_NAME}" PROPERTIES
|
||||
RELWITHDEBINFO_OUTPUT_NAME "${SM_NAME_RELWITHDEBINFO}"
|
||||
)
|
||||
|
||||
if (WITH_VERSION_INFO)
|
||||
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_VERSION_INFO)
|
||||
endif()
|
||||
|
||||
if (WITH_PORTABLE_TOMCRYPT)
|
||||
sm_add_compile_definition("${SM_EXE_NAME}" LTC_NO_ASM)
|
||||
elseif (WITH_NO_ROLC_TOMCRYPT OR APPLE)
|
||||
@@ -365,8 +370,6 @@ elseif(APPLE)
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${SM_XCODE_DIR}/Hardware.plist" "$<TARGET_FILE_DIR:StepMania>/../Resources/"
|
||||
)
|
||||
else() # Linux
|
||||
# TODO: Have this compile definition be used all over. Currently fixed for Windows and Mac, but in headers.
|
||||
sm_add_compile_definition("${SM_EXE_NAME}" "${ENDIANNESS}")
|
||||
set_target_properties("${SM_EXE_NAME}" PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${SM_ROOT_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${SM_ROOT_DIR}"
|
||||
@@ -610,6 +613,7 @@ target_link_libraries("${SM_EXE_NAME}" ${SMDATA_LINK_LIB})
|
||||
|
||||
list(APPEND SM_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
"${SM_SRC_DIR}/generated"
|
||||
"${SM_EXTERN_DIR}/vorbis"
|
||||
)
|
||||
if(NOT APPLE)
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
#ifndef RAGE_EXCEPTION_H
|
||||
#define RAGE_EXCEPTION_H
|
||||
|
||||
#if defined(CMAKE_POWERED)
|
||||
#include "config.hpp"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Namespace for throwing fatal errors.
|
||||
*
|
||||
|
||||
@@ -6,14 +6,19 @@
|
||||
#include "RageUtil_FileDB.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <cerrno>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if !defined(WIN32)
|
||||
|
||||
#if defined(HAVE_DIRENT_H)
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include "archutils/Win32/ErrorStrings.h"
|
||||
#include <windows.h>
|
||||
|
||||
@@ -9,8 +9,11 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if !defined(WIN32)
|
||||
|
||||
#if defined(HAVE_DIRENT_H)
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#ifndef RAGE_FILE_DRIVER_DIRECT_HELPERS_H
|
||||
#define RAGE_FILE_DRIVER_DIRECT_HELPERS_H
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#define DoOpen open
|
||||
#define DoStat stat
|
||||
|
||||
@@ -43,7 +43,9 @@
|
||||
#include "RageUtil.h"
|
||||
#include "RageFileManager_ReadAhead.h"
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <cerrno>
|
||||
#if defined(WIN32)
|
||||
#include <io.h>
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#include "RageThreads.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <cerrno>
|
||||
#if defined(WIN32)
|
||||
#include <io.h>
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
#include "Foreach.h"
|
||||
#include "RageLog.h"
|
||||
|
||||
#if !defined(_WINDOWS)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* Implement threaded read-ahead buffering.
|
||||
*
|
||||
* If a buffer is low on data, keep filling until it has a g_iMinFillFrames.
|
||||
|
||||
+1
-1
@@ -563,7 +563,7 @@ RString Basename( const RString &dir );
|
||||
RString Dirname( const RString &dir );
|
||||
RString Capitalize( const RString &s );
|
||||
|
||||
#ifndef WIN32
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h> /* correct place with correct definitions */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
#include "archutils/Common/PthreadHelpers.h"
|
||||
#include "archutils/Unix/EmergencyShutdown.h"
|
||||
#include "archutils/Unix/AssertionHandler.h"
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
@@ -5,8 +5,13 @@
|
||||
#include "LinuxInputManager.h"
|
||||
#include "GamePreferences.h" //needed for Axis Fix
|
||||
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
#include "LinuxInputManager.h"
|
||||
#include "RageInputDevice.h" // NUM_JOYSTICKS
|
||||
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <linux/kd.h>
|
||||
#include <linux/keyboard.h>
|
||||
|
||||
@@ -8,7 +8,11 @@
|
||||
#include "Foreach.h"
|
||||
|
||||
#include <string> // std::string::npos
|
||||
|
||||
#if defined(HAVE_DIRENT_H)
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
RString getDevice(RString inputDir, RString type)
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
#include "global.h"
|
||||
#include <stdio.h>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <termios.h>
|
||||
#include <errno.h>
|
||||
#include "LightsDriver_LinuxWeedTech.h"
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
#include "global.h"
|
||||
#include <stdio.h>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include "LightsDriver_Linux_PIUIO.h"
|
||||
#include "GameState.h"
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
#include "global.h"
|
||||
#include <stdio.h>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include "LightsDriver_Linux_PIUIO_Leds.h"
|
||||
#include "GameState.h"
|
||||
|
||||
@@ -6,8 +6,14 @@
|
||||
#include "RageTimer.h"
|
||||
|
||||
#include <cerrno>
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_DIRENT_H)
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -9,11 +9,15 @@
|
||||
#include <IOKit/storage/IOMedia.h>
|
||||
#include <IOKit/usb/USBSpec.h>
|
||||
#include <IOKit/usb/IOUSBLib.h>
|
||||
#if defined(HAVE_SYS_PARAM_H)
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#include <sys/ucred.h>
|
||||
#include <sys/mount.h>
|
||||
#include <paths.h>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
class MemoryCardDriverThreaded_MacOSX::Helper
|
||||
{
|
||||
|
||||
@@ -6,8 +6,12 @@
|
||||
#include "RageSoundManager.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
@@ -10,9 +10,13 @@
|
||||
#endif
|
||||
|
||||
#if defined(LINUX)
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#ifndef PID_THREAD_HELPERS_H
|
||||
#define PID_THREAD_HELPERS_H
|
||||
|
||||
#if defined(HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include "global.h"
|
||||
|
||||
RString ThreadsVersion();
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
|
||||
#if defined(CPU_X86)
|
||||
|
||||
#if defined(HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
inline uint32_t ArchSwap32( uint32_t n )
|
||||
{
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
#include "arch/ArchHooks/ArchHooks.h"
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#include <sys/types.h>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
RString CrashHandler::GetLogsDirectory()
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
// Replace the main function.
|
||||
extern "C" int sm_main( int argc, char *argv[] );
|
||||
|
||||
#define HAVE_VERSION_INFO
|
||||
#define HAVE_CXA_DEMANGLE
|
||||
#define HAVE_FFMPEG
|
||||
#define HAVE_PTHREAD_COND_TIMEDWAIT
|
||||
@@ -12,11 +11,6 @@ extern "C" int sm_main( int argc, char *argv[] );
|
||||
* this in all cases. If only they could be consistent... */
|
||||
#define HAVE_DECL_SIGUSR1 1
|
||||
|
||||
/* We have <machine/endian.h> which gets pulled in when we use gcc 4.0's <cstdlib>
|
||||
* but no <endian.h>. The definitions of LITTLE_ENDIAN, BIG_ENDIAN and end up conflicting
|
||||
* even though they resolve to the same thing (bug in gcc?). */
|
||||
#define HAVE_MACHINE_ENDIAN_H
|
||||
#define HAVE_INTTYPES_H
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#define CRASH_HANDLER
|
||||
|
||||
@@ -25,7 +19,6 @@ extern "C" int sm_main( int argc, char *argv[] );
|
||||
#define NO_GL_FLUSH
|
||||
|
||||
#define CPU_X86
|
||||
#define ENDIAN_LITTLE
|
||||
#define BACKTRACE_METHOD_X86_DARWIN
|
||||
#define BACKTRACE_LOOKUP_METHOD_DLADDR
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#include "RageUtil.h"
|
||||
#include "RageException.h"
|
||||
#include "archutils/Unix/EmergencyShutdown.h"
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
/* We can define this symbol to catch failed assert() calls. This is only used
|
||||
|
||||
@@ -2,13 +2,17 @@
|
||||
#include "Backtrace.h"
|
||||
#include "RageUtil.h"
|
||||
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <cstdlib>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <cerrno>
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#if defined(BACKTRACE_METHOD_X86_LINUX)
|
||||
#include "archutils/Common/PthreadHelpers.h"
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstdarg>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <cstring>
|
||||
#include <cerrno>
|
||||
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstdarg>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <cerrno>
|
||||
#include <limits.h>
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <csignal>
|
||||
|
||||
#include "RageLog.h" /* for RageLog::GetAdditionalLog, etc, only */
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "global.h"
|
||||
#include "GetSysInfo.h"
|
||||
|
||||
#if defined(HAVE_SYS_UTSNAME_H)
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
|
||||
void GetKernel( RString &sys, int &iVersion )
|
||||
{
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
#include "archutils/Common/PthreadHelpers.h"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/mman.h>
|
||||
#include <cerrno>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <alloca.h>
|
||||
#endif
|
||||
|
||||
#if !defined(MISSING_STDINT_H) /* need to define int64_t if so */
|
||||
#if defined(HAVE_STDINT_H) /* need to define int64_t if so */
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
@@ -19,13 +19,7 @@
|
||||
#ifdef BSD
|
||||
#undef ALIGN
|
||||
#undef MACHINE
|
||||
#if defined(__NetBSD_Version__) && __NetBSD_Version__ < 299000900
|
||||
#define lrintf(x) ((int)rint(x))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* For RageLog */
|
||||
#define HAVE_VERSION_INFO
|
||||
|
||||
#include "archutils/Common/gcc_byte_swaps.h"
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#include <commctrl.h>
|
||||
#include "archutils/Win32/ddk/dbghelp.h"
|
||||
#include <io.h>
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <shellapi.h>
|
||||
|
||||
#include "arch/ArchHooks/ArchHooks.h"
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#pragma warning (disable : 4005) // macro redefinitions (ARRAYSIZE)
|
||||
#endif
|
||||
|
||||
#define snprintf _snprintf // Unsure if this goes with __MINGW32__ right now.
|
||||
|
||||
/*
|
||||
The following warnings are disabled in all builds.
|
||||
Enable them in the project file at your peril (or if you feel like
|
||||
@@ -82,7 +80,6 @@ C4355: 'this' : used in base member initializer list
|
||||
|
||||
#endif
|
||||
|
||||
#include <direct.h> // has stuff that should be in unistd.h
|
||||
#include <wchar.h> // needs to be included before our fixes below
|
||||
|
||||
#define lstat stat
|
||||
@@ -90,9 +87,6 @@ C4355: 'this' : used in base member initializer list
|
||||
#define isnan _isnan
|
||||
#define isfinite _finite
|
||||
|
||||
// mkdir is missing the mode arg
|
||||
#define mkdir(p,m) mkdir(p)
|
||||
|
||||
typedef time_t time_t;
|
||||
struct tm;
|
||||
struct tm *my_localtime_r( const time_t *timep, struct tm *result );
|
||||
@@ -135,43 +129,12 @@ int64_t llabs( int64_t i ) { return i >= 0 ? i : -i; }
|
||||
#undef max
|
||||
#define NOMINMAX // make sure Windows doesn't try to define this
|
||||
|
||||
// Windows is missing some basic math functions:
|
||||
// But MinGW isn't.
|
||||
#if !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER < 1700) // cstdint and truncf were first implemented in Visual Studio 2012
|
||||
#define NEED_TRUNCF
|
||||
#define MISSING_STDINT_H
|
||||
#endif
|
||||
|
||||
// MinGW provides us with this function already
|
||||
|
||||
#if !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER < 1800) // lrintf, roundf and strtof were first implemented in Visual Studio 2013
|
||||
#define NEED_ROUNDF
|
||||
#define NEED_STRTOF
|
||||
inline long int lrintf( float f )
|
||||
{
|
||||
int retval;
|
||||
|
||||
_asm fld f;
|
||||
_asm fistp retval;
|
||||
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
// For RageLog.
|
||||
#define HAVE_VERSION_INFO
|
||||
|
||||
/* We implement the crash handler interface (though that interface isn't
|
||||
* completely uniform across platforms yet). */
|
||||
#if !defined(SMPACKAGE)
|
||||
#define CRASH_HANDLER
|
||||
#endif
|
||||
|
||||
// autoconf does this for us
|
||||
#if !defined(__MINGW32__)
|
||||
#define ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) // It might be MinGW or Cygwin(?)
|
||||
#include "archutils/Common/gcc_byte_swaps.h"
|
||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1310) // Byte swap functions were first implemented in Visual Studio .NET 2003
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
#ifndef CONFIG_HPP_
|
||||
#define CONFIG_HPP_
|
||||
|
||||
/* Auto-generated config.h file powered by cmake. */
|
||||
|
||||
/* Defined to 1 if <alloca.h> is found. */
|
||||
#cmakedefine HAVE_ALLOCA_H 1
|
||||
|
||||
/* Defined to 1 if <dirent.h> is found. */
|
||||
#cmakedefine HAVE_DIRENT_H 1
|
||||
|
||||
/* Defined to 1 if <inttypes.h> is found. */
|
||||
#cmakedefine HAVE_INTTYPES_H 1
|
||||
|
||||
/* Defined to 1 if <stdint.h> is found. */
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
|
||||
/* Defined to 1 if <endian.h> is found. */
|
||||
#cmakedefine HAVE_ENDIAN_H 1
|
||||
|
||||
/* Defined to 1 if <sys/endian.h> is found. */
|
||||
#cmakedefine HAVE_SYS_ENDIAN_H 1
|
||||
|
||||
/* Defined to 1 if <machine/endian.h> is found. */
|
||||
#cmakedefine HAVE_MACHINE_ENDIAN_H 1
|
||||
|
||||
/* Defined to 1 if <sys/param.h> is found. */
|
||||
#cmakedefine HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Defined to 1 if <sys/utsname.h> is found. */
|
||||
#cmakedefine HAVE_SYS_UTSNAME_H 1
|
||||
|
||||
/* Defined to 1 if <fcntl.h> is found. */
|
||||
#cmakedefine HAVE_FCNTL_H 1
|
||||
|
||||
/* Defined to 1 if <unistd.h> is found. */
|
||||
#cmakedefine HAVE_UNISTD_H 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the _mkdir function. */
|
||||
#cmakedefine HAVE__MKDIR 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the mkdir function. */
|
||||
#cmakedefine HAVE_MKDIR 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the _snprintf function. */
|
||||
#cmakedefine HAVE__SNPRINTF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the snprintf function. */
|
||||
#cmakedefine HAVE_SNPRINTF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the powf function. */
|
||||
#cmakedefine HAVE_POWF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the sqrtf function. */
|
||||
#cmakedefine HAVE_SQRTF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the sinf function. */
|
||||
#cmakedefine HAVE_SINF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the tanf function. */
|
||||
#cmakedefine HAVE_TANF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the cos function. */
|
||||
#cmakedefine HAVE_COSF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the acos function. */
|
||||
#cmakedefine HAVE_ACOSF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the truncf function. */
|
||||
#cmakedefine HAVE_TRUNCF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the roundf function. */
|
||||
#cmakedefine HAVE_ROUNDF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the lrintf function. */
|
||||
#cmakedefine HAVE_LRINTF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the strtof function. */
|
||||
#cmakedefine HAVE_STRTOF 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the M_PI constant. */
|
||||
#cmakedefine HAVE_M_PI 1
|
||||
|
||||
/* Provide a fallback if intptr_t is not defined. */
|
||||
#cmakedefine HAVE_SIZEOF_INTPTR_T 1
|
||||
#if !defined(HAVE_SIZEOF_INTPTR_T)
|
||||
typedef unsigned int intptr_t;
|
||||
#endif
|
||||
|
||||
/* Provide a fallback if pid_t is not defined. */
|
||||
#cmakedefine HAVE_SIZEOF_PID_T 1
|
||||
#if !defined(HAVE_SIZEOF_PID_T)
|
||||
typedef int pid_t;
|
||||
#endif
|
||||
|
||||
/* Provide a fallback if size_t is not defined. */
|
||||
#cmakedefine HAVE_SIZEOF_SIZE_T 1
|
||||
#if !defined(HAVE_SIZEOF_SIZE_T)
|
||||
typedef unsigned long size_t;
|
||||
#endif
|
||||
|
||||
/* Provide a fallback if ssize_t is not defined. */
|
||||
#cmakedefine HAVE_SIZEOF_SSIZE_T 1
|
||||
#if !defined(HAVE_SIZEOF_SSIZE_T)
|
||||
typedef long ssize_t;
|
||||
#endif
|
||||
|
||||
/* Defined to 1 if the underlying system uses little endian. */
|
||||
#cmakedefine ENDIAN_LITTLE 1
|
||||
|
||||
/* Defined to 1 if the underlying system uses big endian. */
|
||||
#cmakedefine ENDIAN_BIG 1
|
||||
|
||||
/* Defined to 1 if version information will be printed out. */
|
||||
#cmakedefine HAVE_VERSION_INFO 1
|
||||
|
||||
#if defined(__GNUC__)
|
||||
/** @brief Define a macro to tell the compiler that a function has printf()
|
||||
* semantics, to aid warning output. */
|
||||
#define PRINTF(a,b) __attribute__((format(__printf__,a,b)))
|
||||
#define CONST_FUNCTION __attribute__((const))
|
||||
#else
|
||||
/** @brief A dummy define to keep things going smoothly. */
|
||||
#define PRINTF(a,b)
|
||||
/** @brief A dummy define to keep things going smoothly. */
|
||||
#define CONST_FUNCTION
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function that acts like a size limited sprintf. */
|
||||
#if defined(HAVE__SNPRINTF)
|
||||
#define snprintf _snprintf
|
||||
#elif !defined(HAVE_SNPRINTF)
|
||||
#error "No size limited sprintf function available. Aborting."
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function that can create a directory on the file system. */
|
||||
#if defined(HAVE__MKDIR)
|
||||
#include <direct.h>
|
||||
#define mkdir(path, mode) _mkdir(path)
|
||||
#else
|
||||
#if !defined(HAVE_MKDIR)
|
||||
#error "No create directory function available. Aborting."
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(__MINGW32__) || defined(__MINGW64__)
|
||||
#define mkdir(path, mode) mkdir(path)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for raising a number by a power to a float. */
|
||||
#if !defined(HAVE_POWF)
|
||||
inline float powf( float x, float y ) CONST_FUNCTION;
|
||||
float powf( float x, float y ) { return float( pow(double(x), double(y)) ); }
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for getting the square root of a number to a float. */
|
||||
#if !defined(HAVE_SQRTF)
|
||||
inline float sqrtf( float x ) CONST_FUNCTION;
|
||||
float sqrtf( float x ) { return float( sqrt(double(x)) ); }
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for getting the sin of a number to a float. */
|
||||
#if !defined(HAVE_SINF)
|
||||
inline float sinf( float x ) CONST_FUNCTION;
|
||||
float sinf( float x ) { return float( sin(double(x)) ); }
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for getting the tan of a number to a float. */
|
||||
#if !defined(HAVE_TANF)
|
||||
inline float tanf( float x ) CONST_FUNCTION;
|
||||
float tanf( float x ) { return float( tan(double(x)) ); }
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for getting the cos of a number to a float. */
|
||||
#if !defined(HAVE_COSF)
|
||||
inline float cosf( float x ) CONST_FUNCTION;
|
||||
float cosf( float x ){ return float( cos(double(x)) ); }
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for getting the arc cos of a number to a float. */
|
||||
#if !defined(HAVE_ACOSF)
|
||||
inline float acosf( float x ) CONST_FUNCTION;
|
||||
float acosf( float x ) { return float( acos(double(x)) ); }
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for truncating a number to a float. */
|
||||
#if !defined(HAVE_TRUNCF)
|
||||
inline float truncf( float f ) CONST_FUNCTION;
|
||||
float truncf( float f ) { return float( int(f) ); }
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for rounding a number to a float. */
|
||||
#if !defined(HAVE_ROUNDF)
|
||||
inline float roundf( float f ) CONST_FUNCTION;
|
||||
float roundf( float f ) { if( f < 0.0f ) return truncf( f-0.5f ); return truncf( f+0.5f ); }
|
||||
#endif
|
||||
|
||||
/* Ensure we have a function for converting a string to a float. */
|
||||
#if !defined(HAVE_STRTOF)
|
||||
inline float strtof( const char *s, char **se ) { return (float) strtod( s, se ); }
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_LRINTF)
|
||||
#if defined(_MSC_VER)
|
||||
inline long lrintf( float f )
|
||||
{
|
||||
int retval;
|
||||
|
||||
_asm fld f;
|
||||
_asm fistp retval;
|
||||
|
||||
return retval;
|
||||
}
|
||||
#else
|
||||
#define lrintf(x) ((int)rint(x))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_M_PI)
|
||||
/* This is only called if the math header files don't include it: stating it here is fine. */
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
|
||||
/* Ensure we have an endianness defined. */
|
||||
#if !defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG)
|
||||
#error "Neither ENDIAN_LITTLE nor ENDIAN_BIG defined. Aborting."
|
||||
#endif
|
||||
|
||||
/* Define standard endianness macros, if they're missing. */
|
||||
#if defined(HAVE_ENDIAN_H)
|
||||
#include <endian.h>
|
||||
#elif defined(HAVE_MACHINE_ENDIAN_H)
|
||||
#include <machine/endian.h>
|
||||
#else
|
||||
/** @brief The macro for little endian order. */
|
||||
#define LITTLE_ENDIAN 1234
|
||||
/** @brief The macro for big endian order. */
|
||||
#define BIG_ENDIAN 4321
|
||||
#if defined(ENDIAN_LITTLE)
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#elif defined(ENDIAN_BIG)
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -15,7 +15,9 @@
|
||||
#elif !defined(__MINGW32__)
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined(_WINDOWS)
|
||||
|
||||
+4
-3
@@ -1,5 +1,9 @@
|
||||
#include "global.h"
|
||||
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WINDOWS)
|
||||
# if defined(CRASH_HANDLER)
|
||||
# define _WIN32_WINDOWS 0x0410 // include Win98 stuff
|
||||
@@ -9,11 +13,8 @@
|
||||
#elif defined(MACOSX)
|
||||
# include "archutils/Darwin/Crash.h"
|
||||
# include <stdlib.h>
|
||||
# include <unistd.h>
|
||||
using CrashHandler::IsDebuggerPresent;
|
||||
using CrashHandler::DebugBreak;
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(CRASH_HANDLER) && (defined(UNIX) || defined(MACOSX))
|
||||
|
||||
+5
-88
@@ -1,7 +1,9 @@
|
||||
#ifndef GLOBAL_H
|
||||
#define GLOBAL_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if defined(CMAKE_POWERED)
|
||||
#include "config.hpp"
|
||||
#elif defined(HAVE_CONFIG_H)
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
@@ -23,30 +25,6 @@
|
||||
#include "archutils/Unix/arch_setup.h"
|
||||
#endif
|
||||
|
||||
/* Set one of these in arch_setup.h. (Don't bother trying to fall back on BYTE_ORDER
|
||||
* if it was already set; too many systems are missing endian.h.) */
|
||||
#if !defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG)
|
||||
#error Neither ENDIAN_LITTLE nor ENDIAN_BIG defined
|
||||
#endif
|
||||
|
||||
/* Define standard endianness macros, if they're missing. */
|
||||
#if defined(HAVE_ENDIAN_H)
|
||||
#include <endian.h>
|
||||
#elif defined(HAVE_MACHINE_ENDIAN_H)
|
||||
#include <machine/endian.h>
|
||||
#else
|
||||
/** @brief The macro for little endian order. */
|
||||
#define LITTLE_ENDIAN 1234
|
||||
/** @brief The macro for big endian order. */
|
||||
#define BIG_ENDIAN 4321
|
||||
#if defined(ENDIAN_LITTLE)
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#elif defined(ENDIAN_BIG)
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Make sure everyone has min and max: */
|
||||
#include <algorithm>
|
||||
|
||||
@@ -56,7 +34,7 @@
|
||||
/* And vector: */
|
||||
#include <vector>
|
||||
|
||||
#if !defined(MISSING_STDINT_H) /* need to define int64_t if so */
|
||||
#if defined(HAVE_STDINT_H) /* need to define int64_t if so */
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#if defined(HAVE_INTTYPES_H)
|
||||
@@ -108,7 +86,7 @@ namespace Checkpoints
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief A crash has occured, and we're not getting out of it easily.
|
||||
* @brief A crash has occurred, and we're not getting out of it easily.
|
||||
*
|
||||
* For most users, this will result in a crashinfo.txt file being generated.
|
||||
* For anyone that is using a debug build, a debug break will be thrown to
|
||||
@@ -165,18 +143,6 @@ template <> struct CompileAssert<true> { };
|
||||
template<int> struct CompileAssertDecl { };
|
||||
#define COMPILE_ASSERT(COND) typedef CompileAssertDecl< sizeof(CompileAssert<!!(COND)>) > CompileAssertInst
|
||||
|
||||
#if defined(__GNUC__)
|
||||
/** @brief Define a macro to tell the compiler that a function has printf()
|
||||
* semantics, to aid warning output. */
|
||||
#define PRINTF(a,b) __attribute__((format(__printf__,a,b)))
|
||||
#define CONST_FUNCTION __attribute__((const))
|
||||
#else
|
||||
/** @brief A dummy define to keep things going smoothly. */
|
||||
#define PRINTF(a,b)
|
||||
/** @brief A dummy define to keep things going smoothly. */
|
||||
#define CONST_FUNCTION
|
||||
#endif
|
||||
|
||||
#include "StdString.h"
|
||||
/** @brief Use RStrings throughout the program. */
|
||||
typedef StdString::CStdString RString;
|
||||
@@ -193,55 +159,6 @@ typedef StdString::CStdString RString;
|
||||
/* Define a few functions if necessary */
|
||||
#include <cmath>
|
||||
|
||||
#ifndef M_PI
|
||||
/** @brief Define Pi to many digits. */
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
|
||||
#ifdef NEED_POWF
|
||||
inline float powf( float x, float y ) CONST_FUNCTION;
|
||||
float powf( float x, float y ) { return float( pow(double(x), double(y)) ); }
|
||||
#endif
|
||||
|
||||
#ifdef NEED_SQRTF
|
||||
inline float sqrtf( float x ) CONST_FUNCTION;
|
||||
float sqrtf( float x ) { return float( sqrt(double(x)) ); }
|
||||
#endif
|
||||
|
||||
#ifdef NEED_SINF
|
||||
inline float sinf( float x ) CONST_FUNCTION;
|
||||
float sinf( float x ) { return float( sin(double(x)) ); }
|
||||
#endif
|
||||
|
||||
#ifdef NEED_TANF
|
||||
inline float tanf( float x ) CONST_FUNCTION;
|
||||
float tanf( float x ) { return float( tan(double(x)) ); }
|
||||
#endif
|
||||
|
||||
#ifdef NEED_COSF
|
||||
inline float cosf( float x ) CONST_FUNCTION;
|
||||
float cosf( float x ){ return float( cos(double(x)) ); }
|
||||
#endif
|
||||
|
||||
#ifdef NEED_ACOSF
|
||||
inline float acosf( float x ) CONST_FUNCTION;
|
||||
float acosf( float x ) { return float( acos(double(x)) ); }
|
||||
#endif
|
||||
|
||||
#ifdef NEED_TRUNCF
|
||||
inline float truncf( float f ) CONST_FUNCTION;
|
||||
float truncf( float f ) { return float( int(f) ); }
|
||||
#endif
|
||||
|
||||
#ifdef NEED_ROUNDF
|
||||
inline float roundf( float f ) CONST_FUNCTION;
|
||||
float roundf( float f ) { if( f < 0.0f ) return truncf( f-0.5f ); return truncf( f+0.5f ); }
|
||||
#endif
|
||||
|
||||
#ifdef NEED_STRTOF
|
||||
inline float strtof( const char *s, char **se ) { return (float) strtod( s, se ); }
|
||||
#endif
|
||||
|
||||
/* Don't include our own headers here, since they tend to change often. */
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user