diff --git a/StepmaniaCore.cmake b/StepmaniaCore.cmake index cda64c097e..90f16537f7 100644 --- a/StepmaniaCore.cmake +++ b/StepmaniaCore.cmake @@ -107,6 +107,7 @@ check_function_exists(waitpid HAVE_WAITPID) # Mostly universal symbols. check_cxx_symbol_exists(strtof cstdlib HAVE_STRTOF) +check_symbol_exists(M_PI math.h HAVE_M_PI) check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) # Checks to make it easier to work with 32-bit/64-bit builds if required. diff --git a/src/config.in.hpp b/src/config.in.hpp index 48af08c6ae..0cfe96dbd0 100644 --- a/src/config.in.hpp +++ b/src/config.in.hpp @@ -60,6 +60,9 @@ /* 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 + /* Defined to 1 if the underlying system provides the posix_fadvise function. */ #cmakedefine HAVE_POSIX_FADVISE 1 @@ -126,6 +129,11 @@ typedef int pid_t; inline float strtof( const char *s, char **se ) { return (float) strtod( s, se ); } #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 + /* Define standard endianness macros, if they're missing. */ #if defined(HAVE_ENDIAN_H) #include