Ver Fonte

Redefined highp_int to int following GLM 0.9.5 conventions

Christophe Riccio há 12 anos atrás
pai
commit
eb9fde1429
3 ficheiros alterados com 37 adições e 37 exclusões
  1. 13 28
      glm/core/setup.hpp
  2. 15 8
      glm/core/type_int.hpp
  3. 9 1
      readme.txt

+ 13 - 28
glm/core/setup.hpp

@@ -223,7 +223,7 @@
 #		define GLM_COMPILER GLM_COMPILER_INTEL12_0
 #	elif __INTEL_COMPILER == 1210
 #		define GLM_COMPILER GLM_COMPILER_INTEL12_1
-#	elif __INTEL_COMPILER == 1300
+#	elif __INTEL_COMPILER >= 1300
 #		define GLM_COMPILER GLM_COMPILER_INTEL13_0
 #	else
 #		define GLM_COMPILER GLM_COMPILER_INTEL
@@ -231,26 +231,11 @@
 
 // CUDA
 #elif defined(__CUDACC__)
-#	define GLM_COMPILER GLM_COMPILER_CUDA
-/*
 #	if CUDA_VERSION < 3000
 #		error "GLM requires CUDA 3.0 or higher"
-#	elif CUDA_VERSION == 3000
-#		define GLM_COMPILER GLM_COMPILER_CUDA30	
-#	elif CUDA_VERSION == 3010
-#		define GLM_COMPILER GLM_COMPILER_CUDA31	
-#	elif CUDA_VERSION == 3020
-#		define GLM_COMPILER GLM_COMPILER_CUDA32	
-#	elif CUDA_VERSION == 4000
-#		define GLM_COMPILER GLM_COMPILER_CUDA40	
-#	elif CUDA_VERSION == 4010
-#		define GLM_COMPILER GLM_COMPILER_CUDA41	
-#	elif CUDA_VERSION == 4020
-#		define GLM_COMPILER GLM_COMPILER_CUDA42
 #	else
 #		define GLM_COMPILER GLM_COMPILER_CUDA
 #	endif
-*/
 
 // Visual C++
 #elif defined(_MSC_VER)
@@ -274,7 +259,7 @@
 #		define GLM_COMPILER GLM_COMPILER_VC2010
 #	elif _MSC_VER == 1700
 #		define GLM_COMPILER GLM_COMPILER_VC2012
-#	elif _MSC_VER == 1800
+#	elif _MSC_VER >= 1800
 #		define GLM_COMPILER GLM_COMPILER_VC2013
 #	else//_MSC_VER
 #		define GLM_COMPILER GLM_COMPILER_VC
@@ -304,7 +289,9 @@
 #		define GLM_COMPILER GLM_COMPILER_CLANG41
 #	elif(__clang_major__ == 4) && (__clang_minor__ == 2)
 #		define GLM_COMPILER GLM_COMPILER_CLANG42
-#	elif(__clang_major__ == 4) && (__clang_minor__ == 3)
+#	elif(__clang_major__ == 4) && (__clang_minor__ >= 3)
+#		define GLM_COMPILER GLM_COMPILER_CLANG43
+#	elif(__clang_major__ > 4)
 #		define GLM_COMPILER GLM_COMPILER_CLANG43
 #	else
 #		define GLM_COMPILER GLM_COMPILER_CLANG
@@ -338,10 +325,10 @@
 #		define GLM_COMPILER (GLM_COMPILER_GCC47)
 #	elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
 #		define GLM_COMPILER (GLM_COMPILER_GCC48)
-#	elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 9)
+#	elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)
+#		define GLM_COMPILER (GLM_COMPILER_GCC49)
+#	elif (__GNUC__ > 4 )
 #		define GLM_COMPILER (GLM_COMPILER_GCC49)
-#	elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)
-#		define GLM_COMPILER (GLM_COMPILER_GCC50)
 #	else
 #		define GLM_COMPILER (GLM_COMPILER_GCC)
 #	endif
@@ -465,17 +452,13 @@
 #		endif
 #	elif(GLM_COMPILER & GLM_COMPILER_VC)
 #		if(defined(_MSC_EXTENSIONS))
-#			if(GLM_COMPILER >= GLM_COMPILER_VC2012)
-#				define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG)
-#			elif(GLM_COMPILER >= GLM_COMPILER_VC2010)
+#			if(GLM_COMPILER >= GLM_COMPILER_VC2010)
 #				define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG)
 #			else
 #				define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG)
 #			endif
 #		else
-#			if(GLM_COMPILER >= GLM_COMPILER_VC2012)
-#				define GLM_LANG GLM_LANG_CXX11
-#			elif(GLM_COMPILER >= GLM_COMPILER_VC2010)
+#			if(GLM_COMPILER >= GLM_COMPILER_VC2010)
 #				define GLM_LANG GLM_LANG_CXX0X
 #			else
 #				define GLM_LANG GLM_LANG_CXX98
@@ -546,7 +529,9 @@
 #elif(defined(GLM_FORCE_SSE2))
 #	define GLM_ARCH (GLM_ARCH_SSE2)
 #elif((GLM_COMPILER & GLM_COMPILER_VC) && (defined(_M_IX86) || defined(_M_X64)))
-#	if(defined(_M_CEE_PURE))
+#	if(GLM_PLATFORM == GLM_PLATFORM_WINCE)
+#		define GLM_ARCH GLM_ARCH_PURE
+#	elif(defined(_M_CEE_PURE))
 #		define GLM_ARCH GLM_ARCH_PURE
 /* TODO: Explore auto detection of instruction set support
 #	elif(defined(_M_IX86_FP))

+ 15 - 8
glm/core/type_int.hpp

@@ -32,8 +32,7 @@
 #include "setup.hpp"
 
 #if(((GLM_LANG & GLM_LANG_CXX11) == GLM_LANG_CXX11) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)))
-//#if((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)))
-#include <cstdint>
+#	include <cstdint>
 #endif
 
 namespace glm{
@@ -78,13 +77,13 @@ namespace detail
 		typedef uint64						uint64;
 #endif//
 	
-	typedef signed short					lowp_int_t;
+	typedef signed int						lowp_int_t;
 	typedef signed int						mediump_int_t;
-	typedef int64							highp_int_t;
+	typedef signed int						highp_int_t;
 	
-	typedef unsigned short					lowp_uint_t;
+	typedef unsigned int					lowp_uint_t;
 	typedef unsigned int					mediump_uint_t;
-	typedef uint64							highp_uint_t;
+	typedef unsigned int					highp_uint_t;
 }//namespace detail
 
 	typedef detail::int8					int8;
@@ -217,7 +216,11 @@ namespace detail
 	GLM_DETAIL_IS_INT(signed short);
 	GLM_DETAIL_IS_INT(signed int);
 	GLM_DETAIL_IS_INT(signed long);
-	GLM_DETAIL_IS_INT(highp_int_t);
+#	if(GLM_LANG >= GLM_LANG_CXX0X)
+		GLM_DETAIL_IS_INT(signed long long);
+#	else
+		GLM_DETAIL_IS_INT(glm::int64);
+#	endif
 	
 	//////////////////
 	// uint
@@ -247,7 +250,11 @@ namespace detail
 	GLM_DETAIL_IS_UINT(unsigned short);
 	GLM_DETAIL_IS_UINT(unsigned int);
 	GLM_DETAIL_IS_UINT(unsigned long);
-	GLM_DETAIL_IS_UINT(highp_uint_t);
+#	if(GLM_LANG >= GLM_LANG_CXX0X)
+		GLM_DETAIL_IS_INT(unsigned long long);
+#	else
+		GLM_DETAIL_IS_INT(glm::uint64);
+#	endif
 
 	//////////////////
 	// bool

+ 9 - 1
readme.txt

@@ -52,14 +52,22 @@ GLM 0.9.5.0: 2013-XX-XX
 - Fixed post increment and decrement operators
 - Fixed perspective with zNear == 0 (#71)
 
+================================================================================
+GLM 0.9.4.6: 2013-08-XX
+--------------------------------------------------------------------------------
+- Fixed detection to select the last known compiler if newer version #106
+- Fixed is_int and is_uint code duplication with GCC and C++11 #107 
+
 ================================================================================
 GLM 0.9.4.5: 2013-08-12
 --------------------------------------------------------------------------------
 - Fixed CUDA support
 - Fixed inclusion of intrinsics in "pure" mode #92
 - Fixed language detection on GCC when the C++0x mode isn't enabled #95
+- Fixed issue #97: register is deprecated in C++11
+- Fixed issue #96: CUDA issues
+- Added Windows CE detection #92
 - Added missing value_ptr for quaternions #99
-- Added WINCE detection #92
 
 ================================================================================
 GLM 0.9.4.4: 2013-05-29