From f206f39c3a2d7941c96f7c7ff0bc4d2253ebd935 Mon Sep 17 00:00:00 2001 From: Dave Reid Date: Fri, 21 Dec 2012 10:38:46 +1000 Subject: [PATCH] Fix MinGW compilation error. --- glm/core/setup.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 7c051199..a52e9de9 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -536,6 +536,13 @@ # define GLM_ARCH GLM_ARCH_PURE #endif +// With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is +// that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems. +// To fix, we just explicitly include intrin.h here. +#if defined(__MINGW32__) && (GLM_ARCH != GLM_ARCH_PURE) +# include +#endif + //#if(GLM_ARCH != GLM_ARCH_PURE) #if(GLM_ARCH & GLM_ARCH_AVX2) # include