From 1b79f583f6b680e093bb3c8d68b3c9da78559e1a Mon Sep 17 00:00:00 2001 From: Aaron Brady Date: Mon, 19 Feb 2024 22:29:16 -0800 Subject: [PATCH] Update hash.hpp to detect msvc this causes errors when building on windows with cl --- glm/gtx/hash.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/glm/gtx/hash.hpp b/glm/gtx/hash.hpp index ef89290b4..a2ac98923 100644 --- a/glm/gtx/hash.hpp +++ b/glm/gtx/hash.hpp @@ -40,8 +40,18 @@ #include "../mat4x3.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 #if GLM_LANG & GLM_LANG_CXX11