diff --git a/glm/core/func_common.inl b/glm/core/func_common.inl index 561f50ef..e8004ecd 100644 --- a/glm/core/func_common.inl +++ b/glm/core/func_common.inl @@ -800,7 +800,7 @@ namespace detail #if(GLM_COMPILER & GLM_COMPILER_VC) return typename genType::bool_type(_isnan(x)); -#elif(defined(ANDROID)) +#elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) return typename genType::bool_type(isnan(x)); #else return typename genType::bool_type(std::isnan(x)); @@ -853,7 +853,7 @@ namespace detail #if(GLM_COMPILER & GLM_COMPILER_VC) return typename genType::bool_type(_fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF); -#elif(defined(ANDROID)) +#elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) return typename genType::bool_type(isinf(x)); #else return typename genType::bool_type(std::isinf(x)); diff --git a/glm/core/setup.hpp b/glm/core/setup.hpp index 56b38949..7fe1a21c 100644 --- a/glm/core/setup.hpp +++ b/glm/core/setup.hpp @@ -38,6 +38,30 @@ #define GLM_VERSION_PATCH 3 #define GLM_VERSION_REVISION 0 +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Platform + +#define GLM_PLATFORM_UNKNOWN 0x00000000 +#define GLM_PLATFORM_WINDOWS 0x00010000 +#define GLM_PLATFORM_LINUX 0x00020000 +#define GLM_PLATFORM_MACOSX 0x00040000 +#define GLM_PLATFORM_IOS 0x00080000 +#define GLM_PLATFORM_ANDROID 0x00100000 + +#ifdef GLM_FORCE_PLATFORM_UNKNOWN +# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN +#elif defined(_WIN32) +# define GLM_PLATFORM GLM_PLATFORM_WINDOWS +#elif defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) +# define GLM_PLATFORM GLM_PLATFORM_IOS +#elif defined(__APPLE__) +# define GLM_PLATFORM GLM_PLATFORM_MACOSX +#elif defined(ANDROID) +# define GLM_PLATFORM GLM_PLATFORM_ANDROID +#else +# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN +#endif// + /////////////////////////////////////////////////////////////////////////////////////////////////// // Compiler