Browse Source

Remove integer C++11 workaround

christophe 1 month ago
parent
commit
c33f2fa56a

+ 0 - 20
glm/detail/func_integer.inl

@@ -7,17 +7,6 @@
 #endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC)
 #endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC)
 #include <limits>
 #include <limits>
 
 
-#if !GLM_HAS_EXTENDED_INTEGER_TYPE
-#	if GLM_COMPILER & GLM_COMPILER_GCC
-#		pragma GCC diagnostic push
-#		pragma GCC diagnostic ignored "-Wlong-long"
-#	endif
-#	if (GLM_COMPILER & GLM_COMPILER_CLANG)
-#		pragma clang diagnostic push
-#		pragma clang diagnostic ignored "-Wc++11-long-long"
-#	endif
-#endif
-
 namespace glm{
 namespace glm{
 namespace detail
 namespace detail
 {
 {
@@ -377,15 +366,6 @@ namespace detail
 	}
 	}
 }//namespace glm
 }//namespace glm
 
 
-#if !GLM_HAS_EXTENDED_INTEGER_TYPE
-#	if GLM_COMPILER & GLM_COMPILER_GCC
-#		pragma GCC diagnostic pop
-#	endif
-#	if (GLM_COMPILER & GLM_COMPILER_CLANG)
-#		pragma clang diagnostic pop
-#	endif
-#endif
-
 #if GLM_CONFIG_SIMD == GLM_ENABLE
 #if GLM_CONFIG_SIMD == GLM_ENABLE
 #	include "func_integer_simd.inl"
 #	include "func_integer_simd.inl"
 #endif
 #endif

+ 49 - 83
glm/detail/setup.hpp

@@ -144,17 +144,6 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 // Has of C++ features
 // Has of C++ features
 
 
-// N1988
-#if GLM_LANG & GLM_LANG_CXX11_FLAG
-#	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_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-		((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)) || \
-		((GLM_COMPILER & GLM_COMPILER_HIP)))
-#endif
-
 // N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
 // N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm
 #if GLM_COMPILER & GLM_COMPILER_CLANG
 #if GLM_COMPILER & GLM_COMPILER_CLANG
 #	define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers)
 #	define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers)
@@ -205,19 +194,6 @@
 		((GLM_COMPILER & GLM_COMPILER_HIP))))
 		((GLM_COMPILER & GLM_COMPILER_HIP))))
 #endif
 #endif
 
 
-// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
-#if GLM_COMPILER & GLM_COMPILER_CLANG
-#	define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions)
-#elif GLM_LANG & GLM_LANG_CXX11_FLAG
-#	define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1
-#else
-#	define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-		((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_HIP))))
-#endif
-
 // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
 // N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
 #if GLM_COMPILER & GLM_COMPILER_CLANG
 #if GLM_COMPILER & GLM_COMPILER_CLANG
 #	define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates)
 #	define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates)
@@ -231,19 +207,6 @@
 		((GLM_COMPILER & GLM_COMPILER_HIP))))
 		((GLM_COMPILER & GLM_COMPILER_HIP))))
 #endif
 #endif
 
 
-// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html
-#if GLM_COMPILER & GLM_COMPILER_CLANG
-#	define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for)
-#elif GLM_LANG & GLM_LANG_CXX11_FLAG
-#	define GLM_HAS_RANGE_FOR 1
-#else
-#	define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
-		((GLM_COMPILER & GLM_COMPILER_INTEL)) || \
-		((GLM_COMPILER & GLM_COMPILER_VC)) || \
-		((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
-		((GLM_COMPILER & GLM_COMPILER_HIP))))
-#endif
-
 // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
 // N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf
 // N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
 // N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html
 #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr...
 #if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr...
@@ -264,29 +227,6 @@
 #	define GLM_CONSTEXPR
 #	define GLM_CONSTEXPR
 #endif
 #endif
 
 
-//
-#if GLM_HAS_CONSTEXPR
-# if (GLM_COMPILER & GLM_COMPILER_CLANG)
-#	if __has_feature(cxx_if_constexpr)
-#		define GLM_HAS_IF_CONSTEXPR 1
-#	else
-# 		define GLM_HAS_IF_CONSTEXPR 0
-#	endif
-# elif (GLM_LANG & GLM_LANG_CXX17_FLAG)
-# 	define GLM_HAS_IF_CONSTEXPR 1
-# else
-# 	define GLM_HAS_IF_CONSTEXPR 0
-# endif
-#else
-#	define GLM_HAS_IF_CONSTEXPR 0
-#endif
-
-#if GLM_HAS_IF_CONSTEXPR
-# 	define GLM_IF_CONSTEXPR if constexpr
-#else
-#	define GLM_IF_CONSTEXPR if
-#endif
-
 // [nodiscard]
 // [nodiscard]
 #if GLM_LANG & GLM_LANG_CXX17_FLAG
 #if GLM_LANG & GLM_LANG_CXX17_FLAG
 #	define GLM_NODISCARD [[nodiscard]]
 #	define GLM_NODISCARD [[nodiscard]]
@@ -294,16 +234,6 @@
 #	define GLM_NODISCARD
 #	define GLM_NODISCARD
 #endif
 #endif
 
 
-//
-#if GLM_LANG & GLM_LANG_CXX11_FLAG
-#	define GLM_HAS_MAKE_SIGNED 1
-#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_HIP))))
-#endif
-
 //
 //
 #if defined(GLM_FORCE_INTRINSICS)
 #if defined(GLM_FORCE_INTRINSICS)
 #	define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\
 #	define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\
@@ -581,9 +511,22 @@ namespace glm
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 // uint
 // uint
 
 
+#include <cstdint>
+
+
 namespace glm{
 namespace glm{
 namespace detail
 namespace detail
 {
 {
+	typedef std::int8_t			int8;
+	typedef std::int16_t		int16;
+	typedef std::int32_t		int32;
+	typedef std::int64_t		int64;
+	
+	typedef std::uint8_t		uint8;
+	typedef std::uint16_t		uint16;
+	typedef std::uint32_t		uint32;
+	typedef std::uint64_t		uint64;
+
 	template<typename T>
 	template<typename T>
 	struct is_int
 	struct is_int
 	{
 	{
@@ -591,32 +534,55 @@ namespace detail
 	};
 	};
 
 
 	template<>
 	template<>
-	struct is_int<unsigned int>
+	struct is_int<int8>
 	{
 	{
 		enum test {value = ~0};
 		enum test {value = ~0};
 	};
 	};
 
 
 	template<>
 	template<>
-	struct is_int<signed int>
+	struct is_int<int16>
 	{
 	{
 		enum test {value = ~0};
 		enum test {value = ~0};
 	};
 	};
-}//namespace detail
 
 
-	typedef unsigned int	uint;
-}//namespace glm
+	template<>
+	struct is_int<int32>
+	{
+		enum test {value = ~0};
+	};
 
 
-///////////////////////////////////////////////////////////////////////////////////
-// 64-bit int
+	template<>
+	struct is_int<int64>
+	{
+		enum test {value = ~0};
+	};
 
 
-#include <cstdint>
+	template<>
+	struct is_int<uint8>
+	{
+		enum test {value = ~0};
+	};
 
 
-namespace glm{
-namespace detail
-{
-	typedef std::uint64_t						uint64;
-	typedef std::int64_t						int64;
+	template<>
+	struct is_int<uint16>
+	{
+		enum test {value = ~0};
+	};
+
+	template<>
+	struct is_int<uint32>
+	{
+		enum test {value = ~0};
+	};
+
+	template<>
+	struct is_int<uint64>
+	{
+		enum test {value = ~0};
+	};
 }//namespace detail
 }//namespace detail
+
+	typedef unsigned int	uint;
 }//namespace glm
 }//namespace glm
 
 
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////

+ 2 - 5
glm/detail/type_quat.hpp

@@ -92,11 +92,8 @@ namespace glm
 		template<typename U, qualifier P>
 		template<typename U, qualifier P>
 		GLM_CTOR_DECL GLM_EXPLICIT qua(qua<U, P> const& q);
 		GLM_CTOR_DECL GLM_EXPLICIT qua(qua<U, P> const& q);
 
 
-		/// Explicit conversion operators
-#		if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
-			GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>() const;
-			GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>() const;
-#		endif
+		GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>() const;
+		GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>() const;
 
 
 		/// Create a quaternion from two normalized axis
 		/// Create a quaternion from two normalized axis
 		///
 		///

+ 0 - 2
glm/detail/type_quat.inl

@@ -240,7 +240,6 @@ namespace detail
 		*this = quat_cast(m);
 		*this = quat_cast(m);
 	}
 	}
 
 
-#	if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
 	template<typename T, qualifier Q>
 	template<typename T, qualifier Q>
 	GLM_FUNC_QUALIFIER qua<T, Q>::operator mat<3, 3, T, Q>() const
 	GLM_FUNC_QUALIFIER qua<T, Q>::operator mat<3, 3, T, Q>() const
 	{
 	{
@@ -252,7 +251,6 @@ namespace detail
 	{
 	{
 		return mat4_cast(*this);
 		return mat4_cast(*this);
 	}
 	}
-#	endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
 
 
 	// -- Unary arithmetic operators --
 	// -- Unary arithmetic operators --
 
 

+ 1 - 8
glm/ext.hpp

@@ -214,11 +214,7 @@
 #include "./gtx/functions.hpp"
 #include "./gtx/functions.hpp"
 #include "./gtx/gradient_paint.hpp"
 #include "./gtx/gradient_paint.hpp"
 #include "./gtx/handed_coordinate_space.hpp"
 #include "./gtx/handed_coordinate_space.hpp"
-
-#if __cplusplus >= 201103L
 #include "./gtx/hash.hpp"
 #include "./gtx/hash.hpp"
-#endif
-
 #include "./gtx/integer.hpp"
 #include "./gtx/integer.hpp"
 #include "./gtx/intersect.hpp"
 #include "./gtx/intersect.hpp"
 #include "./gtx/io.hpp"
 #include "./gtx/io.hpp"
@@ -260,8 +256,5 @@
 #if GLM_HAS_TEMPLATE_ALIASES
 #if GLM_HAS_TEMPLATE_ALIASES
 #	include "./gtx/scalar_multiplication.hpp"
 #	include "./gtx/scalar_multiplication.hpp"
 #endif
 #endif
-
-#if GLM_HAS_RANGE_FOR
-#	include "./gtx/range.hpp"
-#endif
+#include "./gtx/range.hpp"
 #endif//GLM_ENABLE_EXPERIMENTAL
 #endif//GLM_ENABLE_EXPERIMENTAL

+ 0 - 32
glm/ext/scalar_int_sized.hpp

@@ -19,38 +19,6 @@
 #endif
 #endif
 
 
 namespace glm{
 namespace glm{
-namespace detail
-{
-#	if GLM_HAS_EXTENDED_INTEGER_TYPE
-		typedef std::int8_t			int8;
-		typedef std::int16_t		int16;
-		typedef std::int32_t		int32;
-#	else
-		typedef signed char			int8;
-		typedef signed short		int16;
-		typedef signed int			int32;
-#endif//
-
-	template<>
-	struct is_int<int8>
-	{
-		enum test {value = ~0};
-	};
-
-	template<>
-	struct is_int<int16>
-	{
-		enum test {value = ~0};
-	};
-
-	template<>
-	struct is_int<int64>
-	{
-		enum test {value = ~0};
-	};
-}//namespace detail
-
-
 	/// @addtogroup ext_scalar_int_sized
 	/// @addtogroup ext_scalar_int_sized
 	/// @{
 	/// @{
 
 

+ 0 - 32
glm/ext/scalar_uint_sized.hpp

@@ -19,38 +19,6 @@
 #endif
 #endif
 
 
 namespace glm{
 namespace glm{
-namespace detail
-{
-#	if GLM_HAS_EXTENDED_INTEGER_TYPE
-		typedef std::uint8_t		uint8;
-		typedef std::uint16_t		uint16;
-		typedef std::uint32_t		uint32;
-#	else
-		typedef unsigned char		uint8;
-		typedef unsigned short		uint16;
-		typedef unsigned int		uint32;
-#endif
-
-	template<>
-	struct is_int<uint8>
-	{
-		enum test {value = ~0};
-	};
-
-	template<>
-	struct is_int<uint16>
-	{
-		enum test {value = ~0};
-	};
-
-	template<>
-	struct is_int<uint64>
-	{
-		enum test {value = ~0};
-	};
-}//namespace detail
-
-
 	/// @addtogroup ext_scalar_uint_sized
 	/// @addtogroup ext_scalar_uint_sized
 	/// @{
 	/// @{
 
 

+ 0 - 12
glm/fwd.hpp

@@ -4,7 +4,6 @@
 
 
 namespace glm
 namespace glm
 {
 {
-#if GLM_HAS_EXTENDED_INTEGER_TYPE
 	typedef std::int8_t				int8;
 	typedef std::int8_t				int8;
 	typedef std::int16_t			int16;
 	typedef std::int16_t			int16;
 	typedef std::int32_t			int32;
 	typedef std::int32_t			int32;
@@ -14,17 +13,6 @@ namespace glm
 	typedef std::uint16_t			uint16;
 	typedef std::uint16_t			uint16;
 	typedef std::uint32_t			uint32;
 	typedef std::uint32_t			uint32;
 	typedef std::uint64_t			uint64;
 	typedef std::uint64_t			uint64;
-#else
-	typedef signed char				int8;
-	typedef signed short			int16;
-	typedef signed int				int32;
-	typedef detail::int64			int64;
-
-	typedef unsigned char			uint8;
-	typedef unsigned short			uint16;
-	typedef unsigned int			uint32;
-	typedef detail::uint64			uint64;
-#endif
 
 
 	// Scalar int
 	// Scalar int
 
 

+ 0 - 2
glm/glm.cppm

@@ -2214,11 +2214,9 @@ export namespace glm {
 		using glm::operator*;
 		using glm::operator*;
 		using glm::operator/;
 		using glm::operator/;
 #       endif
 #       endif
-#       if GLM_HAS_RANGE_FOR
 		using glm::components;
 		using glm::components;
 		using glm::begin;
 		using glm::begin;
 		using glm::end;
 		using glm::end;
-#       endif
 
 
 		using glm::abs;
 		using glm::abs;
 		using glm::acos;
 		using glm::acos;

+ 8 - 23
glm/gtc/type_precision.hpp

@@ -195,29 +195,21 @@ namespace glm
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
 	typedef detail::int64 highp_i64;
 	typedef detail::int64 highp_i64;
 
 
-
-#if GLM_HAS_EXTENDED_INTEGER_TYPE
-	using std::int8_t;
-	using std::int16_t;
-	using std::int32_t;
-	using std::int64_t;
-#else
 	/// 8 bit signed integer type.
 	/// 8 bit signed integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
-	typedef detail::int8 int8_t;
+	using std::int8_t;
 
 
 	/// 16 bit signed integer type.
 	/// 16 bit signed integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
-	typedef detail::int16 int16_t;
+	using std::int16_t;
 
 
 	/// 32 bit signed integer type.
 	/// 32 bit signed integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
-	typedef detail::int32 int32_t;
+	using std::int32_t;
 
 
 	/// 64 bit signed integer type.
 	/// 64 bit signed integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
-	typedef detail::int64 int64_t;
-#endif
+	using std::int64_t;
 
 
 	/// 8 bit signed integer type.
 	/// 8 bit signed integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
@@ -382,28 +374,21 @@ namespace glm
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
 	typedef detail::uint64 highp_u64;
 	typedef detail::uint64 highp_u64;
 
 
-#if GLM_HAS_EXTENDED_INTEGER_TYPE
-	using std::uint8_t;
-	using std::uint16_t;
-	using std::uint32_t;
-	using std::uint64_t;
-#else
 	/// Default qualifier 8 bit unsigned integer type.
 	/// Default qualifier 8 bit unsigned integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
-	typedef detail::uint8 uint8_t;
+	using std::uint8_t;
 
 
 	/// Default qualifier 16 bit unsigned integer type.
 	/// Default qualifier 16 bit unsigned integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
-	typedef detail::uint16 uint16_t;
+	using std::uint16_t;
 
 
 	/// Default qualifier 32 bit unsigned integer type.
 	/// Default qualifier 32 bit unsigned integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
-	typedef detail::uint32 uint32_t;
+	using std::uint32_t;
 
 
 	/// Default qualifier 64 bit unsigned integer type.
 	/// Default qualifier 64 bit unsigned integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision
-	typedef detail::uint64 uint64_t;
-#endif
+	using std::uint64_t;
 
 
 	/// Default qualifier 8 bit unsigned integer type.
 	/// Default qualifier 8 bit unsigned integer type.
 	/// @see gtc_type_precision
 	/// @see gtc_type_precision

+ 0 - 10
test/gtx/gtx_range.cpp

@@ -3,8 +3,6 @@
 #include <glm/ext/vector_relational.hpp>
 #include <glm/ext/vector_relational.hpp>
 #include <glm/glm.hpp>
 #include <glm/glm.hpp>
 
 
-#if GLM_HAS_RANGE_FOR
-
 #define GLM_ENABLE_EXPERIMENTAL
 #define GLM_ENABLE_EXPERIMENTAL
 #include <glm/gtx/range.hpp>
 #include <glm/gtx/range.hpp>
 
 
@@ -73,11 +71,3 @@ int main()
 	return Error;
 	return Error;
 }
 }
 
 
-#else
-
-int main()
-{
-	return 0;
-}
-
-#endif//GLM_HAS_RANGE_FOR