Removed Apple specific check for LLVM versions

This commit is contained in:
Christophe Riccio 2016-05-04 18:46:59 +02:00
parent 20da5a25db
commit 93612791cd
6 changed files with 31 additions and 80 deletions

View File

@ -255,7 +255,7 @@
# define GLM_CXX11_STATIC_ASSERT
# endif
#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
#elif(GLM_COMPILER & GLM_COMPILER_LLVM)
# if(__has_feature(cxx_exceptions))
# define GLM_CXX98_EXCEPTIONS
# endif
@ -396,4 +396,4 @@
# define GLM_CXX11_VARIADIC_TEMPLATES
# endif
#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
#endif//(GLM_COMPILER & GLM_COMPILER_LLVM)

View File

@ -527,7 +527,7 @@ namespace detail
# else
return ::isnan(x) != 0;
# endif
# elif (GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L
# elif (GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM)) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L
return _isnan(x) != 0;
# elif GLM_COMPILER & GLM_COMPILER_CUDA
return isnan(x) != 0;
@ -561,7 +561,7 @@ namespace detail
# else
return ::isinf(x);
# endif
# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM)
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L)
return _isinf(x) != 0;
# else

View File

@ -28,10 +28,8 @@
# pragma message("GLM: CUDA compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_VC
# pragma message("GLM: Visual C++ compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_APPLE_CLANG
# pragma message("GLM: Clang compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_LLVM
# pragma message("GLM: LLVM compiler detected")
# pragma message("GLM: Clang compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_INTEL
# pragma message("GLM: Intel Compiler detected")
# elif GLM_COMPILER & GLM_COMPILER_GCC
@ -94,7 +92,7 @@
# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
#elif defined(GLM_FORCE_SSE2)
# define GLM_ARCH (GLM_ARCH_SSE2)
#elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX))
#elif (GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX))
// This is Skylake set of instruction set
# if defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512CD__) && defined(__AVX512VL__) && defined(__AVX512DQ__)
# define GLM_ARCH (GLM_ARCH_AVX512 | GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
@ -225,7 +223,7 @@
#elif defined(GLM_FORCE_CXX98)
# define GLM_LANG GLM_LANG_CXX98
#else
# if GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)
# if GLM_COMPILER & GLM_COMPILER_LLVM
# if __cplusplus >= 201402L // GLM_COMPILER_LLVM34 + -std=c++14
# define GLM_LANG GLM_LANG_CXX14
# elif __has_feature(cxx_decltype_auto) && __has_feature(cxx_aggregate_nsdmi) // GLM_COMPILER_LLVM33 + -std=c++1y
@ -358,7 +356,7 @@
#if GLM_PLATFORM == GLM_PLATFORM_ANDROID || GLM_PLATFORM == GLM_PLATFORM_CYGWIN
# define GLM_HAS_CXX11_STL 0
#elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#elif GLM_COMPILER & GLM_COMPILER_LLVM
# if __has_include(<__config>) // libc++
# include <__config>
//# else // libstdc++
@ -377,7 +375,7 @@
#endif
// N1720
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_STATIC_ASSERT 1
@ -396,12 +394,11 @@
((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_CUDA)) || \
((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_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)) || \
((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_LLVM) && (GLM_COMPILER >= GLM_COMPILER_LLVM30)))
#endif
// N2235
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_CONSTEXPR __has_feature(cxx_constexpr)
# define GLM_HAS_CONSTEXPR_PARTIAL GLM_HAS_CONSTEXPR
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
@ -414,7 +411,7 @@
#endif
// N2672
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_INITIALIZER_LISTS 1
@ -429,7 +426,7 @@
#define GLM_NOT_BUGGY_VC32BITS (!(GLM_MODEL == GLM_MODEL_32 && (GLM_COMPILER & GLM_COMPILER_VC) && GLM_COMPILER < GLM_COMPILER_VC2013))
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions)
#elif GLM_LANG & (GLM_LANG_CXX11_FLAG | GLM_LANG_CXXMS_FLAG)
# define GLM_HAS_UNRESTRICTED_UNIONS 1
@ -442,7 +439,7 @@
#endif
// N2346
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_DEFAULTED_FUNCTIONS 1
@ -455,7 +452,7 @@
#endif
// N2118
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_RVALUE_REFERENCES 1
@ -467,7 +464,7 @@
#endif
// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1
@ -480,7 +477,7 @@
#endif
// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_TEMPLATE_ALIASES 1
@ -493,7 +490,7 @@
#endif
// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
#if GLM_COMPILER & GLM_COMPILER_LLVM
# define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for)
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
# define GLM_HAS_RANGE_FOR 1
@ -608,7 +605,7 @@
# if GLM_COMPILER & GLM_COMPILER_VC
# define GLM_INLINE __forceinline
# define GLM_NEVER_INLINE __declspec((noinline))
# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)
# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM)
# define GLM_INLINE inline __attribute__((__always_inline__))
# define GLM_NEVER_INLINE __attribute__((__noinline__))
# elif GLM_COMPILER & GLM_COMPILER_CUDA
@ -688,7 +685,7 @@
# else
# define GLM_VECTOR_CALL
# endif
#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_CUDA | GLM_COMPILER_INTEL)
#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM | GLM_COMPILER_CUDA | GLM_COMPILER_INTEL)
# define GLM_DEPRECATED __attribute__((__deprecated__))
# define GLM_ALIGN(x) __attribute__((aligned(x)))
# define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x)))

View File

@ -151,7 +151,7 @@ namespace detail
else if(glm::isinf(x))
return 0x1Fu << 6u;
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & GLM_COMPILER_LLVM)
uint Pack = 0u;
memcpy(&Pack, &x, sizeof(Pack));
# else
@ -172,7 +172,7 @@ namespace detail
uint Result = packed11ToFloat(x);
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & GLM_COMPILER_LLVM)
float Temp = 0;
memcpy(&Temp, &Result, sizeof(Temp));
return Temp;
@ -190,7 +190,7 @@ namespace detail
else if(glm::isinf(x))
return 0x1Fu << 5u;
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & GLM_COMPILER_LLVM)
uint Pack = 0;
memcpy(&Pack, &x, sizeof(Pack));
# else
@ -211,7 +211,7 @@ namespace detail
uint Result = packed10ToFloat(x);
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
# if(GLM_COMPILER & GLM_COMPILER_GCC || GLM_COMPILER & GLM_COMPILER_LLVM)
float Temp = 0;
memcpy(&Temp, &Result, sizeof(Temp));
return Temp;

View File

@ -127,16 +127,6 @@
#define GLM_COMPILER_LLVM38 0x20000090
#define GLM_COMPILER_LLVM39 0x200000A0
// Apple Clang
#define GLM_COMPILER_APPLE_CLANG 0x40000000
#define GLM_COMPILER_APPLE_CLANG40 0x40000010
#define GLM_COMPILER_APPLE_CLANG41 0x40000020
#define GLM_COMPILER_APPLE_CLANG42 0x40000030
#define GLM_COMPILER_APPLE_CLANG50 0x40000040
#define GLM_COMPILER_APPLE_CLANG51 0x40000050
#define GLM_COMPILER_APPLE_CLANG60 0x40000060
#define GLM_COMPILER_APPLE_CLANG61 0x40000070
// Build model
#define GLM_MODEL_32 0x00000010
#define GLM_MODEL_64 0x00000020
@ -192,24 +182,18 @@
// Clang
#elif defined(__clang__)
# if GLM_PLATFORM & GLM_PLATFORM_APPLE
# if __clang_major__ == 4 && __clang_minor__ == 0
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG40
# elif __clang_major__ == 4 && __clang_minor__ == 1
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG41
# elif __clang_major__ == 4 && __clang_minor__ == 2
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG42
# elif __clang_major__ == 5 && __clang_minor__ == 0
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG50
# if __clang_major__ == 5 && __clang_minor__ == 0
# define GLM_COMPILER GLM_COMPILER_LLVM33
# elif __clang_major__ == 5 && __clang_minor__ == 1
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG51
# define GLM_COMPILER GLM_COMPILER_LLVM34
# elif __clang_major__ == 6 && __clang_minor__ == 0
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG60
# define GLM_COMPILER GLM_COMPILER_LLVM35
# elif __clang_major__ == 6 && __clang_minor__ >= 1
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61
# define GLM_COMPILER GLM_COMPILER_LLVM36
# elif __clang_major__ >= 7
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61
# define GLM_COMPILER GLM_COMPILER_LLVM37
# else
# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG
# define GLM_COMPILER GLM_COMPILER_LLVM
# endif
# else
# if __clang_major__ == 3 && __clang_minor__ == 0

View File

@ -84,36 +84,6 @@ int test_compiler()
{
std::printf("GLM_COMPILER_CUDA\n");
}
else if(GLM_COMPILER & GLM_COMPILER_APPLE_CLANG)
{
switch(GLM_COMPILER)
{
case GLM_COMPILER_APPLE_CLANG40:
std::printf("GLM_COMPILER_APPLE_CLANG40\n");
break;
case GLM_COMPILER_APPLE_CLANG41:
std::printf("GLM_COMPILER_APPLE_CLANG41\n");
break;
case GLM_COMPILER_APPLE_CLANG42:
std::printf("GLM_COMPILER_APPLE_CLANG42\n");
break;
case GLM_COMPILER_APPLE_CLANG50:
std::printf("GLM_COMPILER_APPLE_CLANG50\n");
break;
case GLM_COMPILER_APPLE_CLANG51:
std::printf("GLM_COMPILER_APPLE_CLANG51\n");
break;
case GLM_COMPILER_APPLE_CLANG60:
std::printf("GLM_COMPILER_APPLE_CLANG60\n");
break;
case GLM_COMPILER_APPLE_CLANG61:
std::printf("GLM_COMPILER_APPLE_CLANG61\n");
break;
default:
std::printf("Apple Clang version not detected\n");
break;
}
}
else if(GLM_COMPILER & GLM_COMPILER_LLVM)
{
switch(GLM_COMPILER)