Fixed C++ 11 detection

This commit is contained in:
Christophe Riccio 2013-01-31 20:45:47 +01:00
parent d52a388000
commit d7ed4387e0
5 changed files with 51 additions and 35 deletions

View File

@ -31,24 +31,24 @@
#include "setup.hpp"
#include <cassert>
//#if((GLM_LANG & GLM_LANG_CXX0X) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)))
#if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
#if(((GLM_LANG & GLM_LANG_CXX11) == GLM_LANG_CXX11) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)))
//#if((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)))
#include <cstdint>
#endif
namespace glm{
namespace detail
{
# if((GLM_LANG & GLM_LANG_CXX0X) == GLM_LANG_CXX0X)
typedef std::int8_t int8;
typedef std::int16_t int16;
typedef std::int32_t int32;
typedef std::int64_t int64;
# if((GLM_LANG & GLM_LANG_CXX11) == GLM_LANG_CXX11)
typedef std::int8_t int8;
typedef std::int16_t int16;
typedef std::int32_t int32;
typedef std::int64_t int64;
typedef std::uint8_t uint8;
typedef std::uint16_t uint16;
typedef std::uint32_t uint32;
typedef std::uint64_t uint64;
typedef std::uint8_t uint8;
typedef std::uint16_t uint16;
typedef std::uint32_t uint32;
typedef std::uint64_t uint64;
# else
# if(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available
typedef int64_t sint64;

View File

@ -32,11 +32,11 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// Version
#define GLM_VERSION 94
#define GLM_VERSION 95
#define GLM_VERSION_MAJOR 0
#define GLM_VERSION_MINOR 9
#define GLM_VERSION_PATCH 4
#define GLM_VERSION_REVISION 2
#define GLM_VERSION_PATCH 5
#define GLM_VERSION_REVISION 0
///////////////////////////////////////////////////////////////////////////////////////////////////
// Platform
@ -417,7 +417,7 @@
// User defines: GLM_FORCE_CXX98
#define GLM_LANG_CXX (0 << 0)
#define GLM_LANG_CXX (1 << 0)
#define GLM_LANG_CXX98 ((1 << 1) | GLM_LANG_CXX)
#define GLM_LANG_CXX03 ((1 << 2) | GLM_LANG_CXX98)
#define GLM_LANG_CXX0X ((1 << 3) | GLM_LANG_CXX03)
@ -433,18 +433,34 @@
# define GLM_LANG GLM_LANG_CXX98
#else
// -std=c++0x or -std=gnu++0x
# if(((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) && defined(__GXX_EXPERIMENTAL_CXX0X__))
# 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))
# if(GLM_COMPILER >= GLM_COMPILER_VC2010)
# define GLM_LANG GLM_LANG_CXX0X
# if((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC)
# if(defined(__GXX_EXPERIMENTAL_CXX0X__))
# if(GLM_COMPILER >= GLM_COMPILER_GCC47)
# define GLM_LANG GLM_LANG_CXX11
# else
# define GLM_LANG GLM_LANG_CXX0X
# endif
# else
# define GLM_LANG GLM_LANG_CXX98
# endif//(GLM_COMPILER == GLM_COMPILER_VC2010)
# elif((GLM_COMPILER & GLM_COMPILER_GCC) == GLM_COMPILER_GCC) //&& defined(__STRICT_ANSI__))
# define GLM_LANG GLM_LANG_CXX98
# endif
# elif((GLM_COMPILER & GLM_COMPILER_VC) == GLM_COMPILER_VC)
# if(defined(_MSC_EXTENSIONS))
# if(GLM_COMPILER >= GLM_COMPILER_VC2012)
# define GLM_LANG GLM_LANG_CXX11 | GLM_LANG_CXXMS
# elif(GLM_COMPILER >= GLM_COMPILER_VC2010)
# define GLM_LANG GLM_LANG_CXX0X | GLM_LANG_CXXMS
# else
# define GLM_LANG GLM_LANG_CXX98 | GLM_LANG_CXXMS
# endif
# else
# if(GLM_COMPILER >= GLM_COMPILER_VC2012)
# define GLM_LANG GLM_LANG_CXX11
# elif(GLM_COMPILER >= GLM_COMPILER_VC2010)
# define GLM_LANG GLM_LANG_CXX0X
# else
# define GLM_LANG GLM_LANG_CXX98
# endif
# endif
# elif((GLM_COMPILER & GLM_COMPILER_CLANG) == GLM_COMPILER_CLANG)
# define GLM_LANG GLM_LANG_CXX98
# else
@ -632,7 +648,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// Static assert
#if(GLM_LANG == GLM_LANG_CXX0X)
#if((GLM_LANG & GLM_LANG_CXX0X) == GLM_LANG_CXX0X)
# define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
#elif(defined(BOOST_STATIC_ASSERT))
# define GLM_STATIC_ASSERT(x, message) BOOST_STATIC_ASSERT(x)

View File

@ -74,9 +74,9 @@ namespace detail
_GLM_SWIZZLE2_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, s, t)
# endif//(defined(GLM_SWIZZLE))
struct{value_type r, g;};
struct{value_type s, t;};
struct{value_type x, y;};
struct {value_type r, g;};
struct {value_type s, t;};
struct {value_type x, y;};
};
# elif(GLM_COMPONENT == GLM_COMPONENT_CXX98)
union {value_type x, r, s;};

View File

@ -74,9 +74,9 @@ namespace detail
_GLM_SWIZZLE3_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, s, t, p)
# endif//(defined(GLM_SWIZZLE))
struct{value_type r, g, b;};
struct{value_type s, t, p;};
struct{value_type x, y, z;};
struct {value_type r, g, b;};
struct {value_type s, t, p;};
struct {value_type x, y, z;};
};
# elif(GLM_COMPONENT == GLM_COMPONENT_CXX98)
union {value_type x, r, s;};

View File

@ -74,9 +74,9 @@ namespace detail
_GLM_SWIZZLE4_4_MEMBERS(value_type, glm::detail::tvec4<value_type>, s, t, p, q)
# endif//(defined(GLM_SWIZZLE))
struct{value_type r, g, b, a;};
struct{value_type s, t, p, q;};
struct{value_type x, y, z, w;};
struct {value_type r, g, b, a;};
struct {value_type s, t, p, q;};
struct {value_type x, y, z, w;};
};
# elif(GLM_COMPONENT == GLM_COMPONENT_CXX98)
union {value_type x, r, s;};