Browse Source

Fixed GCC build, GLM_META_PROG_HELPERS unsupported with GCC 4.6

Christophe Riccio 10 years ago
parent
commit
4f7afb272f

+ 7 - 2
test/core/core_type_vec1.cpp

@@ -29,8 +29,10 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
+#if !(GLM_COMPILER & GLM_COMPILER_GCC)
+#	define GLM_META_PROG_HELPERS
+#endif
 #define GLM_SWIZZLE
 #define GLM_SWIZZLE
-#define GLM_META_PROG_HELPERS
 #include <glm/vector_relational.hpp>
 #include <glm/vector_relational.hpp>
 #include <glm/gtc/vec1.hpp>
 #include <glm/gtc/vec1.hpp>
 #include <vector>
 #include <vector>
@@ -170,7 +172,10 @@ int main()
 
 
 	glm::vec1 v;
 	glm::vec1 v;
 	assert(v.length() == 1);
 	assert(v.length() == 1);
-	assert(glm::vec1::components == 1);
+
+#	ifdef GLM_META_PROG_HELPERS
+		assert(glm::vec1::components == 1);
+#	endif
 
 
 	Error += test_vec1_size();
 	Error += test_vec1_size();
 	Error += test_vec1_ctor();
 	Error += test_vec1_ctor();

+ 7 - 2
test/core/core_type_vec2.cpp

@@ -29,7 +29,9 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
-#define GLM_META_PROG_HELPERS
+#if !(GLM_COMPILER & GLM_COMPILER_GCC)
+#	define GLM_META_PROG_HELPERS
+#endif
 #define GLM_SWIZZLE
 #define GLM_SWIZZLE
 #include <glm/vector_relational.hpp>
 #include <glm/vector_relational.hpp>
 #include <glm/vec2.hpp>
 #include <glm/vec2.hpp>
@@ -329,7 +331,10 @@ int main()
 
 
 	glm::vec2 v;
 	glm::vec2 v;
 	assert(v.length() == 2);
 	assert(v.length() == 2);
-	assert(glm::vec2::components == 2);
+
+#	ifdef GLM_META_PROG_HELPERS
+		assert(glm::vec2::components == 2);
+#	endif
 
 
 	Error += test_vec2_size();
 	Error += test_vec2_size();
 	Error += test_vec2_ctor();
 	Error += test_vec2_ctor();

+ 7 - 2
test/core/core_type_vec3.cpp

@@ -29,7 +29,9 @@
 /// @author Christophe Riccio
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
-#define GLM_META_PROG_HELPERS
+#if !(GLM_COMPILER & GLM_COMPILER_GCC)
+#	define GLM_META_PROG_HELPERS
+#endif
 #define GLM_SWIZZLE
 #define GLM_SWIZZLE
 #include <glm/vector_relational.hpp>
 #include <glm/vector_relational.hpp>
 #include <glm/geometric.hpp>
 #include <glm/geometric.hpp>
@@ -497,7 +499,10 @@ int main()
 
 
 	glm::vec3 v;
 	glm::vec3 v;
 	assert(v.length() == 3);
 	assert(v.length() == 3);
-	assert(glm::vec3::components == 3);
+
+#	ifdef GLM_META_PROG_HELPERS
+		assert(glm::vec3::components == 3);
+#	endif
 
 
 	Error += test_vec3_ctor();
 	Error += test_vec3_ctor();
 	Error += test_vec3_operators();
 	Error += test_vec3_operators();

+ 7 - 2
test/core/core_type_vec4.cpp

@@ -30,7 +30,9 @@
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
 
 
 //#define GLM_FORCE_AVX2
 //#define GLM_FORCE_AVX2
-#define GLM_META_PROG_HELPERS
+#if !(GLM_COMPILER & GLM_COMPILER_GCC)
+#	define GLM_META_PROG_HELPERS
+#endif
 #define GLM_SWIZZLE
 #define GLM_SWIZZLE
 #include <glm/vector_relational.hpp>
 #include <glm/vector_relational.hpp>
 #include <glm/vec2.hpp>
 #include <glm/vec2.hpp>
@@ -449,7 +451,10 @@ int main()
 
 
 	glm::vec4 v;
 	glm::vec4 v;
 	assert(v.length() == 4);
 	assert(v.length() == 4);
-	assert(glm::vec4::components == 4);
+
+#	ifdef GLM_META_PROG_HELPERS
+		assert(glm::vec4::components == 4);
+#	endif
 
 
 #	ifdef NDEBUG
 #	ifdef NDEBUG
 		std::size_t const Size(1000000);
 		std::size_t const Size(1000000);