|
|
@@ -29,6 +29,7 @@
|
|
|
#pragma once
|
|
|
|
|
|
#include "setup.hpp"
|
|
|
+#include <type_traits>
|
|
|
|
|
|
#if GLM_HAS_EXTENDED_INTEGER_TYPE
|
|
|
# include <cstdint>
|
|
|
@@ -84,157 +85,139 @@ namespace detail
|
|
|
typedef unsigned int mediump_uint_t;
|
|
|
typedef unsigned int highp_uint_t;
|
|
|
|
|
|
- template <typename genType>
|
|
|
- struct make_signed
|
|
|
- {};
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<int8>
|
|
|
- {
|
|
|
- typedef int8 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<uint8>
|
|
|
- {
|
|
|
- typedef int8 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<int16>
|
|
|
- {
|
|
|
- typedef int16 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<uint16>
|
|
|
- {
|
|
|
- typedef int16 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<int32>
|
|
|
- {
|
|
|
- typedef int32 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<uint32>
|
|
|
- {
|
|
|
- typedef int32 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<int64>
|
|
|
- {
|
|
|
- typedef int64 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<uint64>
|
|
|
- {
|
|
|
- typedef int64 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<long>
|
|
|
- {
|
|
|
- typedef long type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<long long>
|
|
|
- {
|
|
|
- typedef long long type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<unsigned long>
|
|
|
- {
|
|
|
- typedef long type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_signed<unsigned long long>
|
|
|
- {
|
|
|
- typedef long long type;
|
|
|
- };
|
|
|
-
|
|
|
- template <typename genType>
|
|
|
- struct make_unsigned
|
|
|
- {};
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<int8>
|
|
|
- {
|
|
|
- typedef uint8 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<uint8>
|
|
|
- {
|
|
|
- typedef uint8 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<int16>
|
|
|
- {
|
|
|
- typedef uint16 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<uint16>
|
|
|
- {
|
|
|
- typedef uint16 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<int32>
|
|
|
- {
|
|
|
- typedef uint32 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<uint32>
|
|
|
- {
|
|
|
- typedef uint32 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<int64>
|
|
|
- {
|
|
|
- typedef uint64 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<uint64>
|
|
|
- {
|
|
|
- typedef uint64 type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<long>
|
|
|
- {
|
|
|
- typedef unsigned long type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<long long>
|
|
|
- {
|
|
|
- typedef unsigned long long type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<unsigned long>
|
|
|
- {
|
|
|
- typedef unsigned long type;
|
|
|
- };
|
|
|
-
|
|
|
- template <>
|
|
|
- struct make_unsigned<unsigned long long>
|
|
|
- {
|
|
|
- typedef unsigned long long type;
|
|
|
- };
|
|
|
+# if GLM_HAS_MAKE_SIGNED
|
|
|
+ using std::make_signed;
|
|
|
+ using std::make_unsigned;
|
|
|
+
|
|
|
+# else//GLM_HAS_MAKE_SIGNED
|
|
|
+ template <typename genType>
|
|
|
+ struct make_signed
|
|
|
+ {};
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<char>
|
|
|
+ {
|
|
|
+ typedef char type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<short>
|
|
|
+ {
|
|
|
+ typedef short type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<int>
|
|
|
+ {
|
|
|
+ typedef int type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<long>
|
|
|
+ {
|
|
|
+ typedef long type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<long long>
|
|
|
+ {
|
|
|
+ typedef long long type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<unsigned char>
|
|
|
+ {
|
|
|
+ typedef char type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<unsigned short>
|
|
|
+ {
|
|
|
+ typedef short type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<unsigned int>
|
|
|
+ {
|
|
|
+ typedef int type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<unsigned long>
|
|
|
+ {
|
|
|
+ typedef long type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_signed<unsigned long long>
|
|
|
+ {
|
|
|
+ typedef long long type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <typename genType>
|
|
|
+ struct make_unsigned
|
|
|
+ {};
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<char>
|
|
|
+ {
|
|
|
+ typedef unsigned char type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<short>
|
|
|
+ {
|
|
|
+ typedef unsigned short type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<int>
|
|
|
+ {
|
|
|
+ typedef unsigned int type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<long>
|
|
|
+ {
|
|
|
+ typedef unsigned long type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<long long>
|
|
|
+ {
|
|
|
+ typedef unsigned long long type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<unsigned char>
|
|
|
+ {
|
|
|
+ typedef unsigned char type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<unsigned short>
|
|
|
+ {
|
|
|
+ typedef unsigned short type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<unsigned int>
|
|
|
+ {
|
|
|
+ typedef unsigned int type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<unsigned long>
|
|
|
+ {
|
|
|
+ typedef unsigned long type;
|
|
|
+ };
|
|
|
+
|
|
|
+ template <>
|
|
|
+ struct make_unsigned<unsigned long long>
|
|
|
+ {
|
|
|
+ typedef unsigned long long type;
|
|
|
+ };
|
|
|
+# endif//GLM_HAS_MAKE_SIGNED
|
|
|
}//namespace detail
|
|
|
|
|
|
typedef detail::int8 int8;
|