Browse Source

Enable only GLM_GTX_scalar_multiplication for C++11 compiler #242

Christophe Riccio 11 years ago
parent
commit
a00fc3fdf4
4 changed files with 23 additions and 2 deletions
  1. 5 2
      glm/ext.hpp
  2. 6 0
      glm/gtx/scalar_multiplication.hpp
  3. 1 0
      readme.txt
  4. 11 0
      test/gtx/gtx_scalar_multiplication.cpp

+ 5 - 2
glm/ext.hpp

@@ -117,8 +117,11 @@
 #include "./gtx/raw_data.hpp"
 #include "./gtx/rotate_vector.hpp"
 #include "./gtx/spline.hpp"
+#if GLM_LANG & GLM_LANG_CXX0X_FLAG
+#	include "./gtx/scalar_multiplication.hpp"
+#endif
 #include "./gtx/std_based_type.hpp"
-#if(!(GLM_COMPILER & GLM_COMPILER_CUDA))
+#if !(GLM_COMPILER & GLM_COMPILER_CUDA)
 #	include "./gtx/string_cast.hpp"
 #endif
 #include "./gtx/transform.hpp"
@@ -128,7 +131,7 @@
 #include "./gtx/vector_query.hpp"
 #include "./gtx/wrap.hpp"
 
-#if(GLM_ARCH & GLM_ARCH_SSE2)
+#if GLM_ARCH & GLM_ARCH_SSE2
 #	include "./gtx/simd_vec4.hpp"
 #	include "./gtx/simd_mat4.hpp"
 #endif

+ 6 - 0
glm/gtx/scalar_multiplication.hpp

@@ -37,6 +37,12 @@
 
 #pragma once
 
+#include "../detail/setup.hpp"
+
+#if !(GLM_LANG & GLM_LANG_CXX0X_FLAG)
+#	error "GLM_GTX_scalar_multiplication requires C++11 suppport"
+#endif
+
 #include "../vec2.hpp"
 #include "../vec3.hpp"
 #include "../vec4.hpp"

+ 1 - 0
readme.txt

@@ -56,6 +56,7 @@ GLM 0.9.6.0: 2014-XX-XX
 - Added vec3 slerp #237
 - Added GTX_common with isdenomal #223
 - Fixed implicit conversion from another tvec2 type to another tvec2 #241
+- Added GTX_scalar_multiplication for C++ 11 compiler only #242
 
 ================================================================================
 GLM 0.9.5.4: 2014-06-21

+ 11 - 0
test/gtx/gtx_scalar_multiplication.cpp

@@ -10,6 +10,8 @@
 #include <glm/glm.hpp>
 #include <glm/gtx/scalar_multiplication.hpp>
 
+#if GLM_LANG & GLM_LANG_CXX0X_FLAG
+
 int main()
 {
 	int Error(0);
@@ -30,3 +32,12 @@ int main()
 
 	return Error;
 }
+
+#else
+
+int main()
+{
+	return 0;
+}
+
+#endif