Browse Source

Update hash.hpp to detect msvc

this causes errors when building on windows with cl
Aaron Brady 1 year ago
parent
commit
e009bcbe7c
1 changed files with 12 additions and 2 deletions
  1. 12 2
      glm/gtx/hash.hpp

+ 12 - 2
glm/gtx/hash.hpp

@@ -40,8 +40,18 @@
 #include "../mat4x3.hpp"
 #include "../mat4x3.hpp"
 #include "../mat4x4.hpp"
 #include "../mat4x4.hpp"
 
 
-#if __cplusplus < 201103L
-#pragma message("GLM_GTX_hash requires C++11 standard library support")
+#if defined(_MSC_VER)
+    // MSVC uses _MSVC_LANG instead of __cplusplus
+    #if _MSVC_LANG < 201103L
+        #pragma message("GLM_GTX_hash requires C++11 standard library support")
+    #endif
+#elif defined(__GNUC__) || defined(__clang__)
+    // GNU and Clang use __cplusplus
+    #if __cplusplus < 201103L
+        #pragma message("GLM_GTX_hash requires C++11 standard library support")
+    #endif
+#else
+    #error "Unknown compiler"
 #endif
 #endif
 
 
 #if GLM_LANG & GLM_LANG_CXX11
 #if GLM_LANG & GLM_LANG_CXX11