From 4552ec737e2c155b6d9c225bdf3b97ab03a67785 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Mon, 5 Oct 2015 18:23:18 -0400 Subject: [PATCH] Wrap tvec2's static constants in GLM_STATIC_CONST_MEMBERS --- glm/detail/type_vec2.hpp | 3 +++ glm/detail/type_vec2.inl | 2 ++ test/core/core_type_vec2.cpp | 2 ++ 3 files changed, 7 insertions(+) diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 762229b3..ddd45564 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -58,10 +58,13 @@ namespace glm static GLM_RELAXED_CONSTEXPR precision prec = P; # endif//GLM_META_PROG_HELPERS +# ifdef GLM_STATIC_CONST_MEMBERS static const type ZERO; static const type X; static const type Y; static const type XY; +# endif + // -- Data -- # if GLM_HAS_ANONYMOUS_UNION diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index db95c67a..f3bc76fa 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -28,6 +28,7 @@ namespace glm { +# ifdef GLM_STATIC_CONST_MEMBERS template const tvec2 tvec2::ZERO = tvec2(static_cast(0), static_cast(0)); @@ -39,6 +40,7 @@ namespace glm template const tvec2 tvec2::XY = tvec2(static_cast(1), static_cast(1)); +# endif // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index 9f2e8d14..11065ea1 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -29,6 +29,7 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// +#define GLM_STATIC_CONST_MEMBERS #if !(GLM_COMPILER & GLM_COMPILER_GCC) # define GLM_META_PROG_HELPERS #endif @@ -40,6 +41,7 @@ # include #endif + int test_vec2_operators() { int Error = 0;