Browse Source

Fixed zero as null pointer constant

Christophe Riccio 8 years ago
parent
commit
6390805e6d
2 changed files with 17 additions and 1 deletions
  1. 16 0
      glm/detail/setup.hpp
  2. 1 1
      glm/gtx/string_cast.inl

+ 16 - 0
glm/detail/setup.hpp

@@ -508,6 +508,22 @@
 #	define GLM_HAS_OPENMP 0
 #	define GLM_HAS_OPENMP 0
 #endif
 #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
+
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 // Static assert
 // Static assert
 
 

+ 1 - 1
glm/gtx/string_cast.inl

@@ -25,7 +25,7 @@ namespace detail
 		char text[STRING_BUFFER];
 		char text[STRING_BUFFER];
 		va_list list;
 		va_list list;
 
 
-		if(msg == 0)
+		if(msg == GLM_NULLPTR)
 			return std::string();
 			return std::string();
 
 
 		va_start(list, msg);
 		va_start(list, msg);