Browse Source

Wrap tvec2's static constants in GLM_STATIC_CONST_MEMBERS

Jesse Talavera-Greenberg 10 years ago
parent
commit
4552ec737e
3 changed files with 7 additions and 0 deletions
  1. 3 0
      glm/detail/type_vec2.hpp
  2. 2 0
      glm/detail/type_vec2.inl
  3. 2 0
      test/core/core_type_vec2.cpp

+ 3 - 0
glm/detail/type_vec2.hpp

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

+ 2 - 0
glm/detail/type_vec2.inl

@@ -28,6 +28,7 @@
 
 namespace glm
 {
+#	ifdef GLM_STATIC_CONST_MEMBERS
 	template <typename T, precision P>
 	const tvec2<T, P> tvec2<T, P>::ZERO = tvec2<T, P>(static_cast<T>(0), static_cast<T>(0));
 
@@ -39,6 +40,7 @@ namespace glm
 
 	template <typename T, precision P>
 	const tvec2<T, P> tvec2<T, P>::XY = tvec2<T, P>(static_cast<T>(1), static_cast<T>(1));
+#	endif
 	// -- Implicit basic constructors --
 
 #	if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)

+ 2 - 0
test/core/core_type_vec2.cpp

@@ -29,6 +29,7 @@
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 
+#define GLM_STATIC_CONST_MEMBERS
 #if !(GLM_COMPILER & GLM_COMPILER_GCC)
 #	define GLM_META_PROG_HELPERS
 #endif
@@ -40,6 +41,7 @@
 #	include <type_traits>
 #endif
 
+
 int test_vec2_operators()
 {
 	int Error = 0;