Ver Fonte

No more warnings for use of long long

Christophe Riccio há 9 anos atrás
pai
commit
c80e142816
2 ficheiros alterados com 41 adições e 21 exclusões
  1. 40 21
      glm/detail/type_int.hpp
  2. 1 0
      readme.md

+ 40 - 21
glm/detail/type_int.hpp

@@ -43,9 +43,9 @@ namespace detail
 		
 #			pragma GCC diagnostic pop
 	
-#		elif GLM_COMPILER & GLM_COMPILER_CLANG
+#		elif (GLM_COMPILER & GLM_COMPILER_CLANG)
 #			pragma clang diagnostic push
-#			pragma clang diagnostic ignored "-Wno-c++11-long-long"
+#			pragma clang diagnostic ignored "-Wc++11-long-long"
 
 			typedef signed long	long		sint64;
 			typedef unsigned long long		uint64;
@@ -108,13 +108,7 @@ namespace detail
 		{
 			typedef long type;
 		};
-
-		template <>
-		struct make_signed<long long>
-		{
-			typedef long long type;
-		};
-
+	
 		template <>
 		struct make_signed<unsigned char>
 		{
@@ -139,12 +133,6 @@ namespace detail
 			typedef long type;
 		};
 
-		template <>
-		struct make_signed<unsigned long long>
-		{
-			typedef long long type;
-		};
-
 		template <typename genType>
 		struct make_unsigned
 		{};
@@ -173,12 +161,6 @@ namespace detail
 			typedef unsigned long type;
 		};
 
-		template <>
-		struct make_unsigned<long long>
-		{
-			typedef unsigned long long type;
-		};
-
 		template <>
 		struct make_unsigned<unsigned char>
 		{
@@ -202,12 +184,49 @@ namespace detail
 		{
 			typedef unsigned long type;
 		};
+	
+#		if GLM_COMPILER & GLM_COMPILER_GCC
+#			pragma GCC diagnostic push
+#			pragma GCC diagnostic ignored "-Wno-long-long"
+#		endif
+	
+#		if GLM_COMPILER & GLM_COMPILER_CLANG
+#			pragma clang diagnostic push
+#			pragma clang diagnostic ignored "-Wc++11-long-long"
+#		endif
 
+		template <>
+		struct make_signed<long long>
+		{
+			typedef long long type;
+		};
+	
+		template <>
+		struct make_signed<unsigned long long>
+		{
+			typedef long long type;
+		};
+	
+		template <>
+		struct make_unsigned<long long>
+		{
+			typedef unsigned long long type;
+		};
+	
 		template <>
 		struct make_unsigned<unsigned long long>
 		{
 			typedef unsigned long long type;
 		};
+
+#		if GLM_COMPILER & GLM_COMPILER_GCC
+#			pragma GCC diagnostic pop
+#		endif
+	
+#		if GLM_COMPILER & GLM_COMPILER_CLANG
+#			pragma clang diagnostic pop
+#		endif
+	
 #	endif//GLM_HAS_MAKE_SIGNED
 }//namespace detail
 

+ 1 - 0
readme.md

@@ -79,6 +79,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
 - Added PowerPC CPUs detection
 - Use Cuda built-in function for abs function implementation with Cuda compiler
 - Factorized GLM_COMPILER_LLVM and GLM_COMPILER_APPLE_CLANG into GLM_COMPILER_CLANG
+- No more warnings for use of long long
 
 ##### Fixes:
 - Fixed GTX_extended_min_max filename typo #386