summaryrefslogtreecommitdiff
path: root/external/glm/clang-cl.patch.0
blob: edbc30b2408bd40a4e89b246bc806c3daa087701 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# "#pragma intrinsic" not (yet?) handled in the "if (LangOpts.MicrosoftExt)"
# block in Preprocessor::RegisterBuiltinPragmas in Clang's lib/Lex/Pragma.cpp:
--- glm/core/func_integer.inl
+++ glm/core/func_integer.inl
@@ -29,7 +29,9 @@
 #if(GLM_ARCH != GLM_ARCH_PURE)
 #if(GLM_COMPILER & GLM_COMPILER_VC)
 #	include <intrin.h>
+#if !defined __clang__
 #	pragma intrinsic(_BitScanReverse)
+#endif
 #endif//(GLM_COMPILER & GLM_COMPILER_VC)
 #endif//(GLM_ARCH != GLM_ARCH_PURE)
 

# Fix check for availability of C++11 static_assert (it apparently should be
# conditional on GLM_LANG_CXX11 instead of GLM_LANG_CXX0X, but just don't care
# to try to fix that mess, and use __cplusplus value instead; unconditionally
# using C++11 static_assert would fail in external/libgltf, which uses
# external/glm but does not -std=c++11); falling back to BOOST_STATIC_ASSERT
# would cause unnecessary warnings with clang-cl:
--- glm/core/setup.hpp
+++ glm/core/setup.hpp
@@ -628,7 +628,7 @@
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Static assert
 
-#if(GLM_LANG == GLM_LANG_CXX0X)
+#if __cplusplus >= 201103L
 #	define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
 #elif(defined(BOOST_STATIC_ASSERT))
 #	define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x)