Browse Source

Added C++0x static_assert support

Christophe Riccio 15 years ago
parent
commit
5b75955336

+ 0 - 61
glm/gtc/double_float.hpp

@@ -1,61 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Created : 2009-04-29
-// Updated : 2009-04-29
-// Licence : This source is under MIT License
-// File    : glm/gtc/double_float.hpp
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Dependency:
-// - GLM core
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Note:
-// - This implementation doesn't need to redefine all build-in functions to
-// support double based type.
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#ifndef glm_gtc_double_float
-#define glm_gtc_double_float
-
-// Dependency:
-#include "../glm.hpp"
-
-namespace glm
-{
-	namespace test{
-		bool main_gtc_double_float();
-	}//namespace test
-
-	namespace gtc{
-	//! GLM_GTC_double_float extension: Add support for double precision floating-point types
-	namespace double_float
-	{
-		//! Vector of 3 single-precision floating-point numbers. 
-		//! From GLM_GTC_double_float extension.
-		typedef detail::tvec3<float>	fvec3;
-		
-		//! Vector of 4 single-precision floating-point numbers. 
-		//! From GLM_GTC_double_float extension.
-		typedef detail::tvec4<float>	fvec4;
-
-		//! 2 * 2 matrix of single-precision floating-point numbers. 
-		//! From GLM_GTC_double_float extension.
-		typedef detail::tmat2x2<float>	fmat2;
-
-		//! 3 * 3 matrix of single-precision floating-point numbers. 
-		//! From GLM_GTC_double_float extension.
-		typedef detail::tmat3x3<float>	fmat3;
-
-		//! 4 * 4 matrix of single-precision floating-point numbers. 
-		//! From GLM_GTC_double_float extension.
-		typedef detail::tmat4x4<float>	fmat4;
-
-	}//namespace double_float
-	}//namespace gtc
-}//namespace glm
-
-#include "double_float.inl"
-
-namespace glm{using namespace gtc::double_float;}
-
-#endif//glm_gtc_double_float

+ 0 - 16
glm/gtc/double_float.inl

@@ -1,16 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Created : 2009-04-29
-// Updated : 2009-04-29
-// Licence : This source is under MIT licence
-// File    : glm/gtc/double_float.inl
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-namespace glm{
-namespace detail
-{
-
-}//namespace detail
-
-}//namespace glm

+ 0 - 40
glm/gtc/gl_replacement.hpp

@@ -1,40 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Created : 2010-11-12
-// Updated : 2010-11-12
-// Licence : This source is under MIT License
-// File    : glm/gtc/gl_replacement.hpp
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Dependency:
-// - GLM core
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#ifndef glm_gl_replacement
-#define glm_gl_replacement
-
-// Dependency:
-#include "../glm.hpp"
-#include "../gtc/matrix_transform.hpp"
-#include "../gtc/matrix_projection.hpp"
-
-namespace glm
-{
-	namespace test{
-		bool main_gtc_gl_replacement();
-	}//namespace test
-
-	namespace gtc{
-	//! GLM_GTC_gl_replacement extension: GLM replacement functions for OpenGL compatibility function
-	namespace gl_replacement
-	{
-
-	}//namespace gl_replacement
-	}//namespace gtc
-}//namespace glm
-
-#include "gl_replacement.inl"
-
-namespace glm{using namespace gtc::gl_replacement;}
-
-#endif//glm_gl_replacement

+ 0 - 18
glm/gtc/gl_replacement.inl

@@ -1,18 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Created : 2010-11-12
-// Updated : 2010-11-12
-// Licence : This source is under MIT License
-// File    : glm/gtc/gl_replacement.inl
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-namespace glm{
-namespace gtc{
-namespace gl_replacement
-{
-
-
-}//namespace gl_replacement
-}//namespace gtc
-}//namespace glm

+ 0 - 40
glm/gtc/glu_replacement.hpp

@@ -1,40 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Created : 2010-11-12
-// Updated : 2010-11-12
-// Licence : This source is under MIT License
-// File    : glm/gtc/gl_replacement.hpp
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Dependency:
-// - GLM core
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-#ifndef glm_glu_replacement
-#define glm_glu_replacement
-
-// Dependency:
-#include "../glm.hpp"
-#include "../gtc/gl_replacement.hpp"
-
-namespace glm
-{
-	namespace test{
-		bool main_gtc_gl_replacement();
-	}//namespace test
-
-	namespace gtc{
-	//! GLM_GTC_glu_replacement extension: GLM replacement functions for GLU
-	namespace glu_replacement
-	{
-		using namespace gtc::gl_replacement;
-
-	}//namespace glu_replacement
-	}//namespace gtc
-}//namespace glm
-
-#include "glu_replacement.inl"
-
-namespace glm{using namespace gtc::glu_replacement;}
-
-#endif//glm_glu_replacement

+ 0 - 18
glm/gtc/glu_replacement.inl

@@ -1,18 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net)
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Created : 2010-11-12
-// Updated : 2010-11-12
-// Licence : This source is under MIT License
-// File    : glm/gtc/glu_replacement.inl
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-namespace glm{
-namespace gtc{
-namespace glu_replacement
-{
-
-
-}//namespace glu_replacement
-}//namespace gtc
-}//namespace glm

+ 5 - 3
glm/setup.hpp

@@ -248,10 +248,12 @@
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Static assert
 
-#if(defined(BOOST_STATIC_ASSERT))
-#define GLM_STATIC_ASSERT(x) BOOST_STATIC_ASSERT(x)
+#if(defined(GLM_LANGUAGE) && GLM_LANGUAGE == GLM_LANGUAGE_CPP0X)
+#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)
 #else
-#define GLM_STATIC_ASSERT(x) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
+#define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
 #endif//GLM_DEPENDENCE
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////