diff --git a/glm/detail/qualifier.hpp b/glm/detail/qualifier.hpp index 08ee5a5c6..aa6089920 100644 --- a/glm/detail/qualifier.hpp +++ b/glm/detail/qualifier.hpp @@ -89,23 +89,21 @@ namespace detail } type; }; -# if GLM_HAS_ALIGNOF - template - struct storage - { - typedef struct alignas(L * sizeof(T)) type { - T data[L]; - } type; - }; + template + struct storage + { + typedef struct alignas(L * sizeof(T)) type { + T data[L]; + } type; + }; - template - struct storage<3, T, true> - { - typedef struct alignas(4 * sizeof(T)) type { - T data[4]; - } type; - }; -# endif + template + struct storage<3, T, true> + { + typedef struct alignas(4 * sizeof(T)) type { + T data[4]; + } type; + }; # if GLM_ARCH & GLM_ARCH_SSE2_BIT template<> @@ -235,12 +233,11 @@ namespace detail { typedef glm_u32vec4 type; }; - +/* TODO: Duplicate ? template<> struct storage<3, unsigned int, true> : public storage<4, unsigned int, true> {}; -# if GLM_HAS_ALIGNOF template<> struct storage<3, double, true> { @@ -248,8 +245,7 @@ namespace detail double data[4]; } type; }; -# endif//GLM_HAS_ALIGNOF - +*/ # endif enum genTypeEnum diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 946d35b03..2d897a838 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -244,19 +244,6 @@ ((GLM_COMPILER & GLM_COMPILER_HIP)))) #endif -// N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_ALIGNOF __has_feature(cxx_alignas) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_ALIGNOF 1 -#else -# define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf // N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr... @@ -307,18 +294,6 @@ # define GLM_NODISCARD #endif -// -#if GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_ASSIGNABLE 1 -#else -# define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))) -#endif - -// -#define GLM_HAS_TRIVIAL_QUERIES 0 - // #if GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_MAKE_SIGNED 1 @@ -384,21 +359,6 @@ # define GLM_HAS_OPENMP 0 #endif -/////////////////////////////////////////////////////////////////////////////////// -// nullptr - -#if GLM_LANG & GLM_LANG_CXX0X_FLAG -# define GLM_CONFIG_NULLPTR GLM_ENABLE -#else -# define GLM_CONFIG_NULLPTR GLM_DISABLE -#endif - -#if GLM_CONFIG_NULLPTR == GLM_ENABLE -# define GLM_NULLPTR nullptr -#else -# define GLM_NULLPTR 0 -#endif - /////////////////////////////////////////////////////////////////////////////////// // Qualifiers @@ -798,7 +758,7 @@ namespace detail /////////////////////////////////////////////////////////////////////////////////// // Use SIMD instruction sets -#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) +#if (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) # define GLM_CONFIG_SIMD GLM_ENABLE #else # define GLM_CONFIG_SIMD GLM_DISABLE @@ -834,7 +794,7 @@ namespace detail # define GLM_FORCE_ALIGNED_GENTYPES #endif -#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE)) +#if (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE)) # define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE #else # define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE @@ -942,26 +902,6 @@ namespace detail # pragma message("GLM: C++ 17 with extensions") # elif (GLM_LANG & GLM_LANG_CXX17_FLAG) # pragma message("GLM: C++ 17") -# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 14 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) -# pragma message("GLM: C++ 14") -# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 11 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) -# pragma message("GLM: C++ 11") -# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 0x with extensions") -# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) -# pragma message("GLM: C++ 0x") -# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 03 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) -# pragma message("GLM: C++ 03") -# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 98 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) -# pragma message("GLM: C++ 98") # else # pragma message("GLM: C++ language undetected") # endif//GLM_LANG diff --git a/test/core/core_force_intrinsics.cpp b/test/core/core_force_intrinsics.cpp index 1f39043fb..db029765c 100644 --- a/test/core/core_force_intrinsics.cpp +++ b/test/core/core_force_intrinsics.cpp @@ -21,7 +21,7 @@ static int test_vec4_ctor() Error += glm::all(glm::equal(A, B)) ? 0 : 1; } -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; @@ -30,7 +30,7 @@ static int test_vec4_ctor() Error += std::is_trivially_copyable::value ? 0 : 1; Error += std::is_copy_constructible::value ? 0 : 1; -# endif + } #if GLM_HAS_INITIALIZER_LISTS { diff --git a/test/core/core_force_pure.cpp b/test/core/core_force_pure.cpp index bca17b531..d5296f5fc 100644 --- a/test/core/core_force_pure.cpp +++ b/test/core/core_force_pure.cpp @@ -22,7 +22,7 @@ static int test_vec4_ctor() Error += glm::all(glm::equal(A, B)) ? 0 : 1; } -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; @@ -31,7 +31,7 @@ static int test_vec4_ctor() Error += std::is_trivially_copyable::value ? 0 : 1; Error += std::is_copy_constructible::value ? 0 : 1; -# endif + } #if GLM_HAS_INITIALIZER_LISTS { diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index 2f2caf52e..4ce7bb40e 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -71,13 +71,11 @@ static int test_ctr() { int Error = 0; -#if GLM_HAS_TRIVIAL_QUERIES //Error += std::is_trivially_default_constructible::value ? 0 : 1; //Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; //Error += std::is_copy_constructible::value ? 0 : 1; //Error += std::has_trivial_copy_constructor::value ? 0 : 1; -#endif #if GLM_HAS_INITIALIZER_LISTS glm::mat4 const m0( diff --git a/test/core/core_type_vec1.cpp b/test/core/core_type_vec1.cpp index 73c15c9fd..6542c7137 100644 --- a/test/core/core_type_vec1.cpp +++ b/test/core/core_type_vec1.cpp @@ -50,7 +50,7 @@ static int test_ctor() { int Error = 0; -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; @@ -59,8 +59,8 @@ static int test_ctor() Error += std::is_trivially_copyable::value ? 0 : 1; Error += std::is_copy_constructible::value ? 0 : 1; -# endif - + } + /* #if GLM_HAS_INITIALIZER_LISTS { diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index c2e3c52be..46099722f 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -6,9 +6,7 @@ #include #include #include -#if GLM_HAS_TRIVIAL_QUERIES -# include -#endif +#include #if GLM_COMPILER & GLM_COMPILER_CLANG # pragma clang diagnostic push @@ -229,7 +227,7 @@ static int test_ctor() Error += A == B ? 0 : 1; } -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; @@ -238,7 +236,7 @@ static int test_ctor() Error += std::is_trivially_copyable::value ? 0 : 1; Error += std::is_copy_constructible::value ? 0 : 1; -# endif + } #if GLM_HAS_INITIALIZER_LISTS { diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index 70dd7da67..e4ac1f2a8 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -27,7 +27,7 @@ static int test_vec3_ctor() { int Error = 0; -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; @@ -36,8 +36,8 @@ static int test_vec3_ctor() Error += std::is_trivially_copyable::value ? 0 : 1; Error += std::is_copy_constructible::value ? 0 : 1; -# endif - + } + # if GLM_HAS_INITIALIZER_LISTS { glm::vec3 a{ 0, 1, 2 }; diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index c64631b51..4b6c599bc 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -56,7 +56,7 @@ static int test_vec4_ctor() Error += glm::all(glm::equal(A, B)) ? 0 : 1; } -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; @@ -65,8 +65,8 @@ static int test_vec4_ctor() Error += std::is_trivially_copyable::value ? 0 : 1; Error += std::is_copy_constructible::value ? 0 : 1; -# endif - + } + #if GLM_HAS_INITIALIZER_LISTS { glm::vec4 a{ 0, 1, 2, 3 }; diff --git a/test/ext/ext_quaternion_type.cpp b/test/ext/ext_quaternion_type.cpp index d5cd3f33c..900e364da 100644 --- a/test/ext/ext_quaternion_type.cpp +++ b/test/ext/ext_quaternion_type.cpp @@ -11,18 +11,18 @@ static int test_ctr() { int Error(0); -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -# endif + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; + } + # if GLM_HAS_INITIALIZER_LISTS { glm::quat A{0, 1, 2, 3}; diff --git a/test/ext/ext_vec1.cpp b/test/ext/ext_vec1.cpp index 1b9ba0f25..c1fa1282f 100644 --- a/test/ext/ext_vec1.cpp +++ b/test/ext/ext_vec1.cpp @@ -48,7 +48,7 @@ static int test_vec1_ctor() { int Error = 0; -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; Error += std::is_trivially_copyable::value ? 0 : 1; @@ -57,8 +57,7 @@ static int test_vec1_ctor() Error += std::is_trivially_copyable::value ? 0 : 1; Error += std::is_copy_constructible::value ? 0 : 1; -# endif - + } { glm::ivec1 A = glm::vec1(2.0f); diff --git a/test/gtx/gtx_dual_quaternion.cpp b/test/gtx/gtx_dual_quaternion.cpp index e6b675782..20957c91d 100644 --- a/test/gtx/gtx_dual_quaternion.cpp +++ b/test/gtx/gtx_dual_quaternion.cpp @@ -5,9 +5,7 @@ #include #include #include -#if GLM_HAS_TRIVIAL_QUERIES -# include -#endif +#include static int myrand() { @@ -161,7 +159,7 @@ static int test_dual_quat_ctr() { int Error(0); -# if GLM_HAS_TRIVIAL_QUERIES + { // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_default_constructible::value ? 0 : 1; // Error += std::is_trivially_copy_assignable::value ? 0 : 1; @@ -171,8 +169,8 @@ static int test_dual_quat_ctr() Error += std::is_copy_constructible::value ? 0 : 1; Error += std::is_copy_constructible::value ? 0 : 1; -# endif - + } + return Error; }