From 1d05f79eb8ab82058251cbd7b42c58dc4a7b6f46 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 24 Sep 2011 23:25:09 +0100 Subject: [PATCH] C++11 tests --- CMakeLists.txt | 4 +++- glm/core/type_vec2.hpp | 8 ++++---- glm/core/type_vec4.hpp | 20 ++++++++++---------- glm/gtc/half_float.hpp | 2 +- glm/gtc/half_float.inl | 2 +- test/core/core_type_vec3.cpp | 3 +++ 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35ea2cc5..93d9325b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,9 @@ if(CMAKE_COMPILER_IS_GNUCXX) #add_definitions(-S) #add_definitions(-s) add_definitions(-msse2) - add_definitions(-std=c++0x ) + add_definitions(-std=c++0x) + add_definitions(-fms-extensions) + add_definitions(-D_MSC_EXTENSIONS) #add_definitions(-m32) #add_definitions(-mfpmath=387) #add_definitions(-ffast-math) diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp index e1256bb6..928c9122 100644 --- a/glm/core/type_vec2.hpp +++ b/glm/core/type_vec2.hpp @@ -62,9 +62,9 @@ namespace detail ////////////////////////////////////// // Data -# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) +# if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) value_type x, y; -# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) +# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT || GLM_LANG == GLM_LANG_CXX0X) union { _GLM_SWIZZLE2_2_MEMBERS(value_type,glm::detail::tvec2,x,y) @@ -81,10 +81,10 @@ namespace detail struct{value_type s, t;}; struct{value_type x, y;}; }; -# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) +# else//(GLM_COMPONENT == GLM_COMPONENT_GLSL_NAMES) union {value_type x, r, s;}; union {value_type y, g, t;}; -# endif//GLM_COMPONENT +# endif//GLM_COMPONENT ////////////////////////////////////// // Accesses diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp index bf34fb31..737607aa 100644 --- a/glm/core/type_vec4.hpp +++ b/glm/core/type_vec4.hpp @@ -64,18 +64,18 @@ namespace detail # if(GLM_COMPONENT == GLM_COMPONENT_ONLY_XYZW) value_type x, y, z, w; -# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT) +# elif(GLM_COMPONENT == GLM_COMPONENT_MS_EXT || GLM_LANG == GLM_LANG_CXX0X) union { - _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,x,y,z,w) - _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,r,g,b,a) - _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,s,t,p,q) - _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,x,y,z,w) - _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,r,g,b,a) - _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,s,t,p,q) - _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,x,y,z,w) - _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,r,g,b,a) - _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,s,t,p,q) + _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,x,y,z,w) + _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,r,g,b,a) + _GLM_SWIZZLE4_2_MEMBERS(value_type,glm::detail::tvec2,s,t,p,q) + _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,x,y,z,w) + _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,r,g,b,a) + _GLM_SWIZZLE4_3_MEMBERS(value_type,glm::detail::tvec3,s,t,p,q) + _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,x,y,z,w) + _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,r,g,b,a) + _GLM_SWIZZLE4_4_MEMBERS(value_type,glm::detail::tvec4,s,t,p,q) struct{value_type r, g, b, a;}; struct{value_type s, t, p, q;}; diff --git a/glm/gtc/half_float.hpp b/glm/gtc/half_float.hpp index 8cb6689d..8c8896de 100644 --- a/glm/gtc/half_float.hpp +++ b/glm/gtc/half_float.hpp @@ -47,7 +47,7 @@ namespace glm{ namespace detail { -#ifndef _MSC_EXTENSIONS +#if 0 //ndef _MSC_EXTENSIONS template <> struct tvec2 { diff --git a/glm/gtc/half_float.inl b/glm/gtc/half_float.inl index 2d20f8a0..624bc6ee 100644 --- a/glm/gtc/half_float.inl +++ b/glm/gtc/half_float.inl @@ -29,7 +29,7 @@ namespace glm{ namespace detail{ -#ifndef _MSC_EXTENSIONS +#if 0//ndef _MSC_EXTENSIONS ////////////////////////////////////// // hvec2 diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index 0e5c4636..b39c6d67 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -9,6 +9,7 @@ #include #include +#include static int test_vec3_operators() { @@ -251,5 +252,7 @@ int main() Error += test_vec3_swizzle_operators(); Error += test_vec3_swizzle_functions(); + printf("Errors: %d\n", Error); + return Error; }