Fix for newer GCC versions.

meow-7.2.2
Nicky 2013-06-27 21:20:07 +02:00
parent a03b2cc53f
commit 1c6fdd35cf
2 changed files with 12 additions and 1 deletions

View File

@ -194,6 +194,13 @@ if (LINUX)
set(CMAKE_CXX_FLAGS "-Wno-attributes ${CMAKE_CXX_FLAGS}")
endif (${CXX_VERSION_NUMBER} GREATER 470)
#</FS:ND>
#<FS:ND> GCC >= 4.6 has constexpr and c++11. Use it
if(${CXX_VERSION_NUMBER} GREATER 460)
add_definitions( -DND_USE_CONSTEXPR )
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif (${CXX_VERSION_NUMBER} GREATER 460)
#</FS:ND>
# End of hacks.

View File

@ -113,7 +113,11 @@ private:
bool play(double rate);
bool getTimePos(double &sec_out);
static const double MIN_LOOP_SEC = 1.0F;
#ifdef ND_USE_CONSTEXPR
static constexpr double MIN_LOOP_SEC = 1.0f;
#else
static double MIN_LOOP_SEC = 1.0f;
#endif
bool mIsLooping;