summaryrefslogtreecommitdiffstats
path: root/external/include/glm/detail/setup.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--external/include/glm/detail/setup.hpp180
1 files changed, 94 insertions, 86 deletions
diff --git a/external/include/glm/detail/setup.hpp b/external/include/glm/detail/setup.hpp
index 68c8cb4..7475916 100644
--- a/external/include/glm/detail/setup.hpp
+++ b/external/include/glm/detail/setup.hpp
@@ -1,46 +1,46 @@
/// @ref core
/// @file glm/detail/setup.hpp
-#pragma once
+#ifndef GLM_SETUP_INCLUDED
-#if (defined(GLM_FORCE_SWIZZLE) || defined(GLM_SWIZZLE)) && defined(GLM_FORCE_UNRESTRICTED_GENTYPE)
+#define GLM_VERSION_MAJOR 0
+#define GLM_VERSION_MINOR 9
+#define GLM_VERSION_PATCH 9
+#define GLM_VERSION_REVISION 0
+#define GLM_VERSION 990
+
+#define GLM_SETUP_INCLUDED GLM_VERSION
+
+#if defined(GLM_FORCE_SWIZZLE) && defined(GLM_FORCE_UNRESTRICTED_GENTYPE)
# error "Both GLM_FORCE_SWIZZLE and GLM_FORCE_UNRESTRICTED_GENTYPE can't be defined at the same time"
#endif
+#include <cassert>
+#include <cstddef>
+
///////////////////////////////////////////////////////////////////////////////////
// Messages
-#ifdef GLM_MESSAGES
-# pragma message("GLM: GLM_MESSAGES is deprecated, use GLM_FORCE_MESSAGES instead")
-#endif
-
#define GLM_MESSAGES_ENABLED 1
#define GLM_MESSAGES_DISABLE 0
-#if defined(GLM_FORCE_MESSAGES) || defined(GLM_MESSAGES)
-# undef GLM_MESSAGES
+#if defined(GLM_FORCE_MESSAGES)
# define GLM_MESSAGES GLM_MESSAGES_ENABLED
#else
-# undef GLM_MESSAGES
# define GLM_MESSAGES GLM_MESSAGES_DISABLE
#endif
-#include <cassert>
-#include <cstddef>
+///////////////////////////////////////////////////////////////////////////////////
+// Detect the platform
+
#include "../simd/platform.h"
///////////////////////////////////////////////////////////////////////////////////
// Version
-#define GLM_VERSION 98
-#define GLM_VERSION_MAJOR 0
-#define GLM_VERSION_MINOR 9
-#define GLM_VERSION_PATCH 8
-#define GLM_VERSION_REVISION 4
-
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_VERSION_DISPLAYED)
# define GLM_MESSAGE_VERSION_DISPLAYED
-# pragma message ("GLM: version 0.9.8.4")
+# pragma message ("GLM: version 0.9.9.0")
#endif//GLM_MESSAGES
// Report compiler detection
@@ -194,28 +194,18 @@
# ifdef _MSC_EXTENSIONS
# if __cplusplus >= 201402L
# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG)
-//# elif GLM_COMPILER >= GLM_COMPILER_VC14
-//# define GLM_LANG (GLM_LANG_CXX1Y | GLM_LANG_CXXMS_FLAG)
# elif __cplusplus >= 201103L
# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG)
-# elif GLM_COMPILER >= GLM_COMPILER_VC10
-# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG)
-# elif __cplusplus >= 199711L
-# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG)
# else
-# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG)
+# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG)
# endif
# else
# if __cplusplus >= 201402L
# define GLM_LANG GLM_LANG_CXX14
# elif __cplusplus >= 201103L
# define GLM_LANG GLM_LANG_CXX11
-# elif GLM_COMPILER >= GLM_COMPILER_VC10
-# define GLM_LANG GLM_LANG_CXX0X
-# elif __cplusplus >= 199711L
-# define GLM_LANG GLM_LANG_CXX98
# else
-# define GLM_LANG GLM_LANG_CXX
+# define GLM_LANG GLM_LANG_CXX0X
# endif
# endif
# elif GLM_COMPILER & GLM_COMPILER_INTEL
@@ -328,7 +318,7 @@
# define GLM_HAS_EXTENDED_INTEGER_TYPE 1
#else
# define GLM_HAS_EXTENDED_INTEGER_TYPE (\
- ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11)) || \
+ ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC)) || \
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)))
@@ -383,7 +373,7 @@
# define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
- ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12)) || \
+ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
(GLM_COMPILER & GLM_COMPILER_CUDA)))
#endif
@@ -395,8 +385,8 @@
#else
# define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC)) || \
- ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11)) || \
- ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
+ ((GLM_COMPILER & GLM_COMPILER_VC)) || \
+ ((GLM_COMPILER & GLM_COMPILER_CUDA))))
#endif
// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
@@ -406,10 +396,10 @@
# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1
#else
# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
- ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC45)) || \
+ ((GLM_COMPILER & GLM_COMPILER_GCC)) || \
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
- ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
+ ((GLM_COMPILER & GLM_COMPILER_CUDA))))
#endif
// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
@@ -419,10 +409,10 @@
# define GLM_HAS_TEMPLATE_ALIASES 1
#else
# define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
- ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL12_1)) || \
+ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC47)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
- ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
+ ((GLM_COMPILER & GLM_COMPILER_CUDA))))
#endif
// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
@@ -433,9 +423,9 @@
#else
# define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC46)) || \
- ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL13)) || \
- ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11)) || \
- ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
+ ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
+ ((GLM_COMPILER & GLM_COMPILER_VC)) || \
+ ((GLM_COMPILER & GLM_COMPILER_CUDA))))
#endif
// N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
@@ -474,7 +464,7 @@
#else
# define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \
- ((GLM_COMPILER & GLM_COMPILER_CUDA) && (GLM_COMPILER >= GLM_COMPILER_CUDA50))))
+ ((GLM_COMPILER & GLM_COMPILER_CUDA))))
#endif
#if GLM_ARCH == GLM_ARCH_PURE
@@ -494,10 +484,6 @@
# define GLM_HAS_OPENMP 40
# elif GLM_COMPILER >= GLM_COMPILER_GCC47
# define GLM_HAS_OPENMP 31
-# elif GLM_COMPILER >= GLM_COMPILER_GCC44
-# define GLM_HAS_OPENMP 30
-# elif GLM_COMPILER >= GLM_COMPILER_GCC42
-# define GLM_HAS_OPENMP 25
# else
# define GLM_HAS_OPENMP 0
# endif
@@ -508,22 +494,34 @@
# define GLM_HAS_OPENMP 0
# endif
# elif GLM_COMPILER & GLM_COMPILER_VC
-# if GLM_COMPILER >= GLM_COMPILER_VC10
-# define GLM_HAS_OPENMP 20
-# else
-# define GLM_HAS_OPENMP 0
-# endif
+# define GLM_HAS_OPENMP 20
# elif GLM_COMPILER & GLM_COMPILER_INTEL
# if GLM_COMPILER >= GLM_COMPILER_INTEL16
# define GLM_HAS_OPENMP 40
-# elif GLM_COMPILER >= GLM_COMPILER_INTEL12
-# define GLM_HAS_OPENMP 31
# else
# define GLM_HAS_OPENMP 0
# endif
# else
# define GLM_HAS_OPENMP 0
-# endif// GLM_COMPILER & GLM_COMPILER_VC
+# endif
+#else
+# define GLM_HAS_OPENMP 0
+#endif
+
+///////////////////////////////////////////////////////////////////////////////////
+// nullptr
+
+//
+#if GLM_LANG & GLM_LANG_CXX0X_FLAG
+# define GLM_HAS_NULLPTR 1
+#else
+# define GLM_HAS_NULLPTR 0
+#endif
+
+#if GLM_HAS_NULLPTR
+# define GLM_NULLPTR nullptr
+#else
+# define GLM_NULLPTR 0
#endif
///////////////////////////////////////////////////////////////////////////////////
@@ -531,8 +529,6 @@
#if GLM_HAS_STATIC_ASSERT
# define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
-#elif defined(BOOST_STATIC_ASSERT)
-# define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x)
#elif GLM_COMPILER & GLM_COMPILER_VC
# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
#else
@@ -584,18 +580,12 @@
// User defines: GLM_FORCE_SWIZZLE
-#ifdef GLM_SWIZZLE
-# pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead")
-#endif
-
#define GLM_SWIZZLE_ENABLED 1
#define GLM_SWIZZLE_DISABLE 0
-#if defined(GLM_FORCE_SWIZZLE) || defined(GLM_SWIZZLE)
-# undef GLM_SWIZZLE
+#if defined(GLM_FORCE_SWIZZLE)
# define GLM_SWIZZLE GLM_SWIZZLE_ENABLED
#else
-# undef GLM_SWIZZLE
# define GLM_SWIZZLE GLM_SWIZZLE_DISABLE
#endif
@@ -627,11 +617,17 @@
#endif//GLM_MESSAGES
///////////////////////////////////////////////////////////////////////////////////
-// Clip control
+// Force single only (remove explicit float64 types)
-#ifdef GLM_DEPTH_ZERO_TO_ONE // Legacy 0.9.8 development
-# error Define GLM_FORCE_DEPTH_ZERO_TO_ONE instead of GLM_DEPTH_ZERO_TO_ONE to use 0 to 1 clip space.
-#endif
+#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_SINGLE_ONLY_DISPLAYED)
+# define GLM_MESSAGE_SINGLE_ONLY_DISPLAYED
+# ifdef GLM_FORCE_SINGLE_ONLY
+# pragma message("GLM: Using only single precision floating-point types")
+# endif
+#endif//GLM_MESSAGES
+
+///////////////////////////////////////////////////////////////////////////////////
+// Clip control
#define GLM_DEPTH_ZERO_TO_ONE 0x00000001
#define GLM_DEPTH_NEGATIVE_ONE_TO_ONE 0x00000002
@@ -655,10 +651,6 @@
// Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM
// to use left handed coordinate system by default.
-#ifdef GLM_LEFT_HANDED // Legacy 0.9.8 development
-# error Define GLM_FORCE_LEFT_HANDED instead of GLM_LEFT_HANDED left handed coordinate system by default.
-#endif
-
#define GLM_LEFT_HANDED 0x00000001 // For DirectX, Metal, Vulkan
#define GLM_RIGHT_HANDED 0x00000002 // For OpenGL, default in GLM
@@ -728,10 +720,15 @@
#if GLM_HAS_DEFAULTED_FUNCTIONS
# define GLM_DEFAULT = default
+
# ifdef GLM_FORCE_NO_CTOR_INIT
-# define GLM_DEFAULT_CTOR = default
-# else
+# undef GLM_FORCE_CTOR_INIT
+# endif
+
+# ifdef GLM_FORCE_CTOR_INIT
# define GLM_DEFAULT_CTOR
+# else
+# define GLM_DEFAULT_CTOR = default
# endif
#else
# define GLM_DEFAULT
@@ -740,7 +737,7 @@
#if GLM_HAS_CONSTEXPR || GLM_HAS_CONSTEXPR_PARTIAL
# define GLM_CONSTEXPR constexpr
-# if GLM_COMPILER & GLM_COMPILER_VC // Visual C++ has a bug #594 https://github.com/g-truc/glm/issues/594
+# if ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER <= GLM_COMPILER_VC14)) // Visual C++ has a bug #594 https://github.com/g-truc/glm/issues/594
# define GLM_CONSTEXPR_CTOR
# else
# define GLM_CONSTEXPR_CTOR constexpr
@@ -756,6 +753,18 @@
# define GLM_RELAXED_CONSTEXPR const
#endif
+#if GLM_LANG >= GLM_LANG_CXX14
+# if ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER <= GLM_COMPILER_VC14)) // Visual C++ < 2017 does not support extended const expressions https://msdn.microsoft.com/en-us/library/hh567368.aspx https://github.com/g-truc/glm/issues/749
+# define GLM_CONSTEXPR_CXX14
+# else
+# define GLM_CONSTEXPR_CXX14 GLM_CONSTEXPR
+# endif
+# define GLM_CONSTEXPR_CTOR_CXX14 GLM_CONSTEXPR_CTOR
+#else
+# define GLM_CONSTEXPR_CXX14
+# define GLM_CONSTEXPR_CTOR_CXX14
+#endif
+
#if GLM_ARCH == GLM_ARCH_PURE
# define GLM_CONSTEXPR_SIMD GLM_CONSTEXPR_CTOR
#else
@@ -773,9 +782,11 @@
#define GLM_HAS_ALIGNED_TYPE GLM_HAS_UNRESTRICTED_UNIONS
///////////////////////////////////////////////////////////////////////////////////
-// Length type
+// Length type: all length functions returns a length_t type.
+// When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise
+// length_t is a typedef of int like GLSL defines it.
-// User defines: GLM_FORCE_SIZE_T_LENGTH GLM_FORCE_SIZE_FUNC
+// User define: GLM_FORCE_SIZE_T_LENGTH
namespace glm
{
@@ -799,14 +810,10 @@ namespace glm
///////////////////////////////////////////////////////////////////////////////////
// countof
-#ifndef __has_feature
-# define __has_feature(x) 0 // Compatibility with non-clang compilers.
-#endif
-
#if GLM_HAS_CONSTEXPR_PARTIAL
namespace glm
{
- template <typename T, std::size_t N>
+ template<typename T, std::size_t N>
constexpr std::size_t countof(T const (&)[N])
{
return N;
@@ -820,9 +827,10 @@ namespace glm
#endif
///////////////////////////////////////////////////////////////////////////////////
-// Uninitialize constructors
+// Check inclusions of different versions of GLM
-namespace glm
-{
- enum ctor{uninitialize};
-}//namespace glm
+#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION))
+# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error."
+#elif GLM_SETUP_INCLUDED == GLM_VERSION
+
+#endif//GLM_SETUP_INCLUDED