Skip to content

Commit e009bcb

Browse files
abradychristophe-lunarg
authored andcommitted
Update hash.hpp to detect msvc
this causes errors when building on windows with cl
1 parent ab2d7b4 commit e009bcb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

glm/gtx/hash.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,18 @@
4040
#include "../mat4x3.hpp"
4141
#include "../mat4x4.hpp"
4242

43-
#if __cplusplus < 201103L
44-
#pragma message("GLM_GTX_hash requires C++11 standard library support")
43+
#if defined(_MSC_VER)
44+
// MSVC uses _MSVC_LANG instead of __cplusplus
45+
#if _MSVC_LANG < 201103L
46+
#pragma message("GLM_GTX_hash requires C++11 standard library support")
47+
#endif
48+
#elif defined(__GNUC__) || defined(__clang__)
49+
// GNU and Clang use __cplusplus
50+
#if __cplusplus < 201103L
51+
#pragma message("GLM_GTX_hash requires C++11 standard library support")
52+
#endif
53+
#else
54+
#error "Unknown compiler"
4555
#endif
4656

4757
#if GLM_LANG & GLM_LANG_CXX11

0 commit comments

Comments
 (0)