From c35bc3d576b2c6a2010586d385ef435ecc273471 Mon Sep 17 00:00:00 2001 From: Amaury Le Leyzour Date: Mon, 9 Sep 2019 17:25:05 -0700 Subject: [PATCH 1/2] Fix Arm 64bit detection __aarch64__ is the correct way, __arm64__ is for iOS. But the memory model does not need any of these architecture defines to be fully relevant. __LP64__ means Long Pointer 64 (ie 64bits), and __ILP32__ is Integer Long Pointer 32 (ie 32bits). That's enough and avoids errors like __arch64__ (correct way is __aarch64__) but forgets __arm64__ (iOS). --- glm/detail/setup.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index cf020fdf..3a5ce18b 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -35,12 +35,12 @@ /////////////////////////////////////////////////////////////////////////////////// // Build model -#if defined(__arch64__) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) +#if defined(__LP64__) # define GLM_MODEL GLM_MODEL_64 -#elif defined(__i386__) || defined(__ppc__) +#elif defined(__ILP32__) # define GLM_MODEL GLM_MODEL_32 #else -# define GLM_MODEL GLM_MODEL_32 +# error "Architecture must be either 32 or 64-bits" #endif// #if !defined(GLM_MODEL) && GLM_COMPILER != 0 From 9b0a0535ce010fe9c61ca264ec5e5697356d93cd Mon Sep 17 00:00:00 2001 From: Amaury Le Leyzour Date: Tue, 10 Sep 2019 11:28:50 -0700 Subject: [PATCH 2/2] Fixing GLM_MODEL for Windows compilers targeting ARM --- glm/detail/setup.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 3a5ce18b..d6025aec 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -35,12 +35,12 @@ /////////////////////////////////////////////////////////////////////////////////// // Build model -#if defined(__LP64__) +#if defined(_M_ARM64) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) # define GLM_MODEL GLM_MODEL_64 -#elif defined(__ILP32__) +#elif defined(__i386__) || defined(__ppc__) || defined(__ILP32__) || defined(_M_ARM) # define GLM_MODEL GLM_MODEL_32 #else -# error "Architecture must be either 32 or 64-bits" +# define GLM_MODEL GLM_MODEL_32 #endif// #if !defined(GLM_MODEL) && GLM_COMPILER != 0