Browse Source

Wrap tvec1's static constants in GLM_STATIC_CONST_MEMBERS

Jesse Talavera-Greenberg 10 years ago
parent
commit
5a60b3986b
3 changed files with 5 additions and 0 deletions
  1. 2 0
      glm/detail/type_vec1.hpp
  2. 2 0
      glm/detail/type_vec1.inl
  3. 1 0
      test/core/core_type_vec1.cpp

+ 2 - 0
glm/detail/type_vec1.hpp

@@ -59,8 +59,10 @@ namespace glm
 			static GLM_RELAXED_CONSTEXPR precision prec = P;
 			static GLM_RELAXED_CONSTEXPR precision prec = P;
 #		endif//GLM_META_PROG_HELPERS
 #		endif//GLM_META_PROG_HELPERS
 
 
+#		ifdef GLM_STATIC_CONST_MEMBERS
 		static const type ZERO;
 		static const type ZERO;
 		static const type X;
 		static const type X;
+#		endif
 		// -- Data --
 		// -- Data --
 
 
 #		if GLM_HAS_ANONYMOUS_UNION
 #		if GLM_HAS_ANONYMOUS_UNION

+ 2 - 0
glm/detail/type_vec1.inl

@@ -32,11 +32,13 @@
 
 
 namespace glm
 namespace glm
 {
 {
+#	ifdef GLM_STATIC_CONST_MEMBERS
 	template<typename T, precision P>
 	template<typename T, precision P>
 	const tvec1<T, P> tvec1<T, P>::X = tvec1<T, P>(static_cast<T>(1));
 	const tvec1<T, P> tvec1<T, P>::X = tvec1<T, P>(static_cast<T>(1));
 
 
 	template<typename T, precision P>
 	template<typename T, precision P>
 	const tvec1<T, P> tvec1<T, P>::ZERO = tvec1<T, P>(static_cast<T>(0));
 	const tvec1<T, P> tvec1<T, P>::ZERO = tvec1<T, P>(static_cast<T>(0));
+#	endif
 	// -- Implicit basic constructors --
 	// -- Implicit basic constructors --
 
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)

+ 1 - 0
test/core/core_type_vec1.cpp

@@ -32,6 +32,7 @@
 #if !(GLM_COMPILER & GLM_COMPILER_GCC)
 #if !(GLM_COMPILER & GLM_COMPILER_GCC)
 #	define GLM_META_PROG_HELPERS
 #	define GLM_META_PROG_HELPERS
 #endif
 #endif
+#define GLM_STATIC_CONST_MEMBERS
 #define GLM_SWIZZLE
 #define GLM_SWIZZLE
 #include <glm/vector_relational.hpp>
 #include <glm/vector_relational.hpp>
 #include <glm/gtc/vec1.hpp>
 #include <glm/gtc/vec1.hpp>