From 5b75955336e68f02acf82feb6dfc0b6c5f529286 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 12 Nov 2010 17:40:52 +0000 Subject: [PATCH] Added C++0x static_assert support --- glm/gtc/double_float.hpp | 61 ------------------------------------- glm/gtc/double_float.inl | 16 ---------- glm/gtc/gl_replacement.hpp | 40 ------------------------ glm/gtc/gl_replacement.inl | 18 ----------- glm/gtc/glu_replacement.hpp | 40 ------------------------ glm/gtc/glu_replacement.inl | 18 ----------- glm/setup.hpp | 8 +++-- 7 files changed, 5 insertions(+), 196 deletions(-) delete mode 100644 glm/gtc/double_float.hpp delete mode 100644 glm/gtc/double_float.inl delete mode 100644 glm/gtc/gl_replacement.hpp delete mode 100644 glm/gtc/gl_replacement.inl delete mode 100644 glm/gtc/glu_replacement.hpp delete mode 100644 glm/gtc/glu_replacement.inl diff --git a/glm/gtc/double_float.hpp b/glm/gtc/double_float.hpp deleted file mode 100644 index 647fd03e..00000000 --- a/glm/gtc/double_float.hpp +++ /dev/null @@ -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 fvec3; - - //! Vector of 4 single-precision floating-point numbers. - //! From GLM_GTC_double_float extension. - typedef detail::tvec4 fvec4; - - //! 2 * 2 matrix of single-precision floating-point numbers. - //! From GLM_GTC_double_float extension. - typedef detail::tmat2x2 fmat2; - - //! 3 * 3 matrix of single-precision floating-point numbers. - //! From GLM_GTC_double_float extension. - typedef detail::tmat3x3 fmat3; - - //! 4 * 4 matrix of single-precision floating-point numbers. - //! From GLM_GTC_double_float extension. - typedef detail::tmat4x4 fmat4; - - }//namespace double_float - }//namespace gtc -}//namespace glm - -#include "double_float.inl" - -namespace glm{using namespace gtc::double_float;} - -#endif//glm_gtc_double_float diff --git a/glm/gtc/double_float.inl b/glm/gtc/double_float.inl deleted file mode 100644 index 7d7a01ef..00000000 --- a/glm/gtc/double_float.inl +++ /dev/null @@ -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 diff --git a/glm/gtc/gl_replacement.hpp b/glm/gtc/gl_replacement.hpp deleted file mode 100644 index 95f83454..00000000 --- a/glm/gtc/gl_replacement.hpp +++ /dev/null @@ -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 diff --git a/glm/gtc/gl_replacement.inl b/glm/gtc/gl_replacement.inl deleted file mode 100644 index e2642e20..00000000 --- a/glm/gtc/gl_replacement.inl +++ /dev/null @@ -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 diff --git a/glm/gtc/glu_replacement.hpp b/glm/gtc/glu_replacement.hpp deleted file mode 100644 index 90a9213a..00000000 --- a/glm/gtc/glu_replacement.hpp +++ /dev/null @@ -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 diff --git a/glm/gtc/glu_replacement.inl b/glm/gtc/glu_replacement.inl deleted file mode 100644 index 22b6d24b..00000000 --- a/glm/gtc/glu_replacement.inl +++ /dev/null @@ -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 diff --git a/glm/setup.hpp b/glm/setup.hpp index b38e8696..d1505c8d 100644 --- a/glm/setup.hpp +++ b/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 ///////////////////////////////////////////////////////////////////////////////////////////////////