Fixed C++ language restriction using GLM_FORCE_CXX**

This commit is contained in:
Christophe Riccio 2014-12-10 21:29:41 +01:00
parent 635f607b86
commit 4340f3fa6f
5 changed files with 27 additions and 23 deletions

Binary file not shown.

Binary file not shown.

View File

@ -329,7 +329,7 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// C++ Version // C++ Version
// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX11, GLM_FORCE_CXX14 // User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14
#define GLM_LANG_CXX98_FLAG (1 << 1) #define GLM_LANG_CXX98_FLAG (1 << 1)
#define GLM_LANG_CXX03_FLAG (1 << 2) #define GLM_LANG_CXX03_FLAG (1 << 2)
@ -351,15 +351,17 @@
#define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG #define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG
#define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG #define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG
#if defined(GLM_FORCE_CXX1Z) #if defined(GLM_FORCE_CXX14)
# define GLM_LANG GLM_LANG_CXX1Z # undef GLM_FORCE_CXX11
#elif defined(GLM_FORCE_CXX14) # undef GLM_FORCE_CXX03
# undef GLM_FORCE_CXX98
# define GLM_LANG GLM_LANG_CXX14 # define GLM_LANG GLM_LANG_CXX14
#elif defined(GLM_FORCE_CXX1Y)
# define GLM_LANG GLM_LANG_CXX1Y
#elif defined(GLM_FORCE_CXX11) #elif defined(GLM_FORCE_CXX11)
# undef GLM_FORCE_CXX03
# undef GLM_FORCE_CXX98
# define GLM_LANG GLM_LANG_CXX11 # define GLM_LANG GLM_LANG_CXX11
#elif defined(GLM_FORCE_CXX03) #elif defined(GLM_FORCE_CXX03)
# undef GLM_FORCE_CXX98
# define GLM_LANG GLM_LANG_CXX03 # define GLM_LANG GLM_LANG_CXX03
#elif defined(GLM_FORCE_CXX98) #elif defined(GLM_FORCE_CXX98)
# define GLM_LANG GLM_LANG_CXX98 # define GLM_LANG GLM_LANG_CXX98
@ -504,20 +506,20 @@
// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
// N1720 // N1720
#define GLM_HAS_CXX11_STL ((GLM_PLATFORM != GLM_PLATFORM_ANDROID) && (\ #define GLM_HAS_CXX11_STL !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ((GLM_PLATFORM != GLM_PLATFORM_ANDROID) && (\
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
__has_include(<__config>))) __has_include(<__config>)))
// N1720 // N1720
#define GLM_HAS_STATIC_ASSERT ( \ #define GLM_HAS_STATIC_ASSERT !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
__has_feature(cxx_static_assert)) __has_feature(cxx_static_assert))
// N1988 // N1988
#define GLM_HAS_EXTENDED_INTEGER_TYPE ( \ #define GLM_HAS_EXTENDED_INTEGER_TYPE !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
@ -525,70 +527,70 @@
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) && (GLM_COMPILER >= GLM_COMPILER_APPLE_CLANG40))) ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_APPLE_CLANG) && (GLM_COMPILER >= GLM_COMPILER_APPLE_CLANG40)))
// N2235 // N2235
#define GLM_HAS_CONSTEXPR ( \ #define GLM_HAS_CONSTEXPR !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
__has_feature(cxx_constexpr)) __has_feature(cxx_constexpr))
// N2672 // N2672
#define GLM_HAS_INITIALIZER_LISTS ( \ #define GLM_HAS_INITIALIZER_LISTS !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \
__has_feature(cxx_generalized_initializers)) __has_feature(cxx_generalized_initializers))
// N2544 Unrestricted unions // N2544 Unrestricted unions
#define GLM_HAS_UNRESTRICTED_UNIONS ( \ #define GLM_HAS_UNRESTRICTED_UNIONS !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
(GLM_LANG & GLM_LANG_CXXMS_FLAG) || \ (GLM_LANG & GLM_LANG_CXXMS_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
__has_feature(cxx_unrestricted_unions)) __has_feature(cxx_unrestricted_unions))
// N2346 // N2346
#define GLM_HAS_DEFAULTED_FUNCTIONS ( \ #define GLM_HAS_DEFAULTED_FUNCTIONS !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC44)) || \
__has_feature(cxx_defaulted_functions)) __has_feature(cxx_defaulted_functions))
// N2118 // N2118
#define GLM_HAS_RVALUE_REFERENCES ( \ #define GLM_HAS_RVALUE_REFERENCES !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)) || \
__has_feature(cxx_rvalue_references)) __has_feature(cxx_rvalue_references))
// N2437 // N2437
#define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ( \ #define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC45)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC45)) || \
__has_feature(cxx_explicit_conversions)) __has_feature(cxx_explicit_conversions))
#define GLM_HAS_STL_ARRAY ( \ #define GLM_HAS_STL_ARRAY !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2010)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43))) ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)))
#define GLM_HAS_TEMPLATE_ALIASES ( \ #define GLM_HAS_TEMPLATE_ALIASES !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) || \
__has_feature(cxx_alias_templates)) __has_feature(cxx_alias_templates))
#define GLM_HAS_RANGE_FOR ( \ #define GLM_HAS_RANGE_FOR !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
__has_feature(cxx_range_for)) __has_feature(cxx_range_for))
#define GLM_HAS_ASSIGNABLE ( \ #define GLM_HAS_ASSIGNABLE !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49))) ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))
#define GLM_HAS_TRIVIAL_QUERIES ( \ #define GLM_HAS_TRIVIAL_QUERIES !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))
#define GLM_HAS_MAKE_SIGNED ( \ #define GLM_HAS_MAKE_SIGNED !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && ( \
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \ (GLM_LANG & GLM_LANG_CXX11_FLAG) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013))) ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)))
@ -617,7 +619,7 @@
#endif #endif
// Not standard // Not standard
#define GLM_HAS_ANONYMOUS_UNION (GLM_LANG & GLM_LANG_CXXMS_FLAG) #define GLM_HAS_ANONYMOUS_UNION !defined(GLM_FORCE_CXX98) && !defined(GLM_FORCE_CXX03) && (GLM_LANG & GLM_LANG_CXXMS_FLAG)
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Platform // Platform

View File

@ -63,7 +63,7 @@ More informations in GLM manual:
http://glm.g-truc.net/glm.pdf http://glm.g-truc.net/glm.pdf
================================================================================ ================================================================================
GLM 0.9.6.1: 2014-12-XX GLM 0.9.6.1: 2014-12-10
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Features: Features:
- Added GLM_LANG_CXX14_FLAG and GLM_LANG_CXX1Z_FLAG language feature flags - Added GLM_LANG_CXX14_FLAG and GLM_LANG_CXX1Z_FLAG language feature flags
@ -83,6 +83,7 @@ Fixes:
- Fixed GLM_FORCE_SIZE_FUNC pragma message - Fixed GLM_FORCE_SIZE_FUNC pragma message
- Fixed C++98 only build - Fixed C++98 only build
- Fixed conflict between GTX_compatibility and GTC_quaternion #286 - Fixed conflict between GTX_compatibility and GTC_quaternion #286
- Fixed C++ language restriction using GLM_FORCE_CXX**
================================================================================ ================================================================================
GLM 0.9.6.0: 2014-11-30 GLM 0.9.6.0: 2014-11-30

View File

@ -34,6 +34,7 @@
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform.hpp> #include <glm/gtx/transform.hpp>
#include <glm/gtx/quaternion.hpp> #include <glm/gtx/quaternion.hpp>
#include <glm/gtx/compatibility.hpp>
#include <glm/ext.hpp> #include <glm/ext.hpp>
int test_quat_fastMix() int test_quat_fastMix()