Fixed compiler setup options

This commit is contained in:
Christophe Riccio 2011-10-19 19:00:44 +01:00
parent 212e1a1f07
commit 1e7923e7b9
9 changed files with 23 additions and 9 deletions

View File

@ -29,6 +29,7 @@
/// dummy.cpp exist only a wordaround for CMake file. /// dummy.cpp exist only a wordaround for CMake file.
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
#define GLM_MESSAGES
#include "../glm.hpp" #include "../glm.hpp"
#include "../ext.hpp" #include "../ext.hpp"

View File

@ -320,14 +320,18 @@
# define GLM_LANG GLM_LANG_CXX03 # define GLM_LANG GLM_LANG_CXX03
#elif(defined(GLM_FORCE_CXX98)) #elif(defined(GLM_FORCE_CXX98))
# define GLM_LANG GLM_LANG_CXX98 # define GLM_LANG GLM_LANG_CXX98
#elif(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__GXX_EXPERIMENTAL_CXX0X__)) // -std=c++0x or -std=gnu++0x
# define GLM_LANG GLM_LANG_CXX0X
#elif(GLM_COMPILER == GLM_COMPILER_VC2010) //_MSC_EXTENSIONS for MS language extensions
# define GLM_LANG GLM_LANG_CXX0X
#elif(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__STRICT_ANSI__)) #elif(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__STRICT_ANSI__))
# define GLM_LANG GLM_LANG_CXX98 # define GLM_LANG GLM_LANG_CXX98
#elif(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__GXX_EXPERIMENTAL_CXX0X__)) // -std=c++0x or -std=gnu++0x
# define GLM_LANG GLM_LANG_CXX0X
#elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && defined(_MSC_EXTENSIONS))
# define GLM_LANG GLM_LANG_CXXMS
#elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && !defined(_MSC_EXTENSIONS)) #elif(((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC) && !defined(_MSC_EXTENSIONS))
# define GLM_LANG GLM_LANG_CXX98 # if(GLM_COMPILER >= GLM_COMPILER_VC2010)
# define GLM_LANG GLM_LANG_CXX0X
# else
# define GLM_LANG GLM_LANG_CXX98
# endif//(GLM_COMPILER == GLM_COMPILER_VC2010)
#else #else
# define GLM_LANG GLM_LANG_CXX # define GLM_LANG GLM_LANG_CXX
#endif #endif
@ -342,6 +346,10 @@
# pragma message("GLM: C++0x") # pragma message("GLM: C++0x")
# elif(GLM_LANG == GLM_LANG_CXX11) # elif(GLM_LANG == GLM_LANG_CXX11)
# pragma message("GLM: C++11") # pragma message("GLM: C++11")
# elif(GLM_LANG == GLM_LANG_CXXGNU)
# pragma message("GLM: C++ with GNU language extensions")
# elif(GLM_LANG == GLM_LANG_CXXMS)
# pragma message("GLM: C++ with VC language extensions")
# endif//GLM_MODEL # endif//GLM_MODEL
#endif//GLM_MESSAGE #endif//GLM_MESSAGE

View File

@ -47,7 +47,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
#if 0 //ndef _MSC_EXTENSIONS #if((GLM_LANG != GLM_LANG_CXX11) && (GLM_LANG != GLM_LANG_CXXMS))
template <> template <>
struct tvec2<thalf> struct tvec2<thalf>
{ {
@ -345,7 +345,7 @@ namespace detail
tvec4<thalf> swizzle(comp X, comp Y, comp Z, comp W) const; tvec4<thalf> swizzle(comp X, comp Y, comp Z, comp W) const;
tref4<thalf> swizzle(comp X, comp Y, comp Z, comp W); tref4<thalf> swizzle(comp X, comp Y, comp Z, comp W);
}; };
#endif//_MSC_EXTENSIONS #endif//((GLM_LANG != GLM_LANG_CXX11) && (GLM_LANG != GLM_LANG_CXXMS))
} }
//namespace detail //namespace detail

View File

@ -7,10 +7,10 @@
// File : test/core/core_func_swizzle.cpp // File : test/core/core_func_swizzle.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_ONLY_XYZW //#define GLM_FORCE_ONLY_XYZW
#define GLM_MESSAGES #define GLM_MESSAGES
#define GLM_SWIZZLE_OPERATOR #define GLM_SWIZZLE_OPERATOR
//#define GLM_FORCE_CXX11 #define GLM_FORCE_CXX98
#include <glm/glm.hpp> #include <glm/glm.hpp>
int test_vec2_swizzle() int test_vec2_swizzle()

View File

@ -7,6 +7,7 @@
// File : test/core/type_vec1.cpp // File : test/core/type_vec1.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_SWIZZLE_OPERATOR
#include <glm/glm.hpp> #include <glm/glm.hpp>
static int test_operators() static int test_operators()

View File

@ -7,6 +7,7 @@
// File : test/core/type_vec2.cpp // File : test/core/type_vec2.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_SWIZZLE_OPERATOR
#include <glm/glm.hpp> #include <glm/glm.hpp>
int test_vec2_operators() int test_vec2_operators()

View File

@ -7,6 +7,7 @@
// File : test/core/type_vec3.cpp // File : test/core/type_vec3.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_SWIZZLE_OPERATOR
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtc/half_float.hpp> #include <glm/gtc/half_float.hpp>
#include <cstdio> #include <cstdio>

View File

@ -7,6 +7,7 @@
// File : test/core/type_vec4.cpp // File : test/core/type_vec4.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_SWIZZLE_OPERATOR
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtc/half_float.hpp> #include <glm/gtc/half_float.hpp>
#include <vector> #include <vector>

View File

@ -7,6 +7,7 @@
// File : test/gtx/string_cast.cpp // File : test/gtx/string_cast.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_MESSAGES
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtx/string_cast.hpp> #include <glm/gtx/string_cast.hpp>
#include <iostream> #include <iostream>