From 6d169bccc260461be1026693c12c2f6d00e648fa Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 15 Jul 2016 22:40:00 +0200 Subject: [PATCH 1/4] Fixed scalar reciprocal functions (GTC_reciprocal) #520 --- glm/detail/func_trigonometric.inl | 2 +- glm/gtc/reciprocal.hpp | 70 +++++++++++++++---------------- readme.md | 1 + 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index 1e70158d..ca0858c5 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -165,7 +165,7 @@ namespace glm # if GLM_HAS_CXX11_STL using std::asinh; # else - template + template GLM_FUNC_QUALIFIER genType asinh(genType const & x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asinh' only accept floating-point input"); diff --git a/glm/gtc/reciprocal.hpp b/glm/gtc/reciprocal.hpp index 72480788..64876019 100644 --- a/glm/gtc/reciprocal.hpp +++ b/glm/gtc/reciprocal.hpp @@ -53,80 +53,80 @@ namespace glm /// @addtogroup gtc_reciprocal /// @{ - /// Secant function. + /// Secant function. /// hypotenuse / adjacent or 1 / cos(x) /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType sec(genType const & angle); + template + GLM_FUNC_DECL genType sec(genType angle); - /// Cosecant function. + /// Cosecant function. /// hypotenuse / opposite or 1 / sin(x) /// /// @see gtc_reciprocal template - GLM_FUNC_DECL genType csc(genType const & angle); + GLM_FUNC_DECL genType csc(genType angle); - /// Cotangent function. + /// Cotangent function. /// adjacent / opposite or 1 / tan(x) /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType cot(genType const & angle); + template + GLM_FUNC_DECL genType cot(genType angle); - /// Inverse secant function. + /// Inverse secant function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType asec(genType const & x); + template + GLM_FUNC_DECL genType asec(genType x); - /// Inverse cosecant function. + /// Inverse cosecant function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType acsc(genType const & x); + template + GLM_FUNC_DECL genType acsc(genType x); - /// Inverse cotangent function. + /// Inverse cotangent function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType acot(genType const & x); + template + GLM_FUNC_DECL genType acot(genType x); - /// Secant hyperbolic function. + /// Secant hyperbolic function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType sech(genType const & angle); + template + GLM_FUNC_DECL genType sech(genType angle); - /// Cosecant hyperbolic function. + /// Cosecant hyperbolic function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType csch(genType const & angle); + template + GLM_FUNC_DECL genType csch(genType angle); - /// Cotangent hyperbolic function. + /// Cotangent hyperbolic function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType coth(genType const & angle); + template + GLM_FUNC_DECL genType coth(genType angle); - /// Inverse secant hyperbolic function. + /// Inverse secant hyperbolic function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType asech(genType const & x); + template + GLM_FUNC_DECL genType asech(genType x); - /// Inverse cosecant hyperbolic function. + /// Inverse cosecant hyperbolic function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType acsch(genType const & x); + template + GLM_FUNC_DECL genType acsch(genType x); - /// Inverse cotangent hyperbolic function. + /// Inverse cotangent hyperbolic function. /// /// @see gtc_reciprocal - template - GLM_FUNC_DECL genType acoth(genType const & x); + template + GLM_FUNC_DECL genType acoth(genType x); /// @} }//namespace glm diff --git a/readme.md b/readme.md index c1a417a9..c064ef38 100644 --- a/readme.md +++ b/readme.md @@ -59,6 +59,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) - Fixed STL for C++11 detection on ICC #510 - Fixed missing vec1 overload to length2 and distance2 functions #431 - Fixed long long warnings when using C++98 on GCC and Clang #482 +- Fixed scalar reciprocal functions (GTC_reciprocal) #520 #### [GLM 0.9.7.5](https://github.com/g-truc/glm/releases/tag/0.9.7.5) - 2016-05-24 ##### Improvements: From 09cbd5f7d63c60291347e27c9e4cc4517deb7514 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 15 Jul 2016 23:11:25 +0200 Subject: [PATCH 2/4] Removed useless const references --- glm/detail/func_trigonometric.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index ca0858c5..4bb24b5c 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -113,7 +113,7 @@ namespace glm // atan template - GLM_FUNC_QUALIFIER genType atan(genType const & y, genType const & x) + GLM_FUNC_QUALIFIER genType atan(genType y, genType x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atan' only accept floating-point input"); @@ -166,7 +166,7 @@ namespace glm using std::asinh; # else template - GLM_FUNC_QUALIFIER genType asinh(genType const & x) + GLM_FUNC_QUALIFIER genType asinh(genType x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asinh' only accept floating-point input"); @@ -185,7 +185,7 @@ namespace glm using std::acosh; # else template - GLM_FUNC_QUALIFIER genType acosh(genType const & x) + GLM_FUNC_QUALIFIER genType acosh(genType x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acosh' only accept floating-point input"); @@ -206,7 +206,7 @@ namespace glm using std::atanh; # else template - GLM_FUNC_QUALIFIER genType atanh(genType const & x) + GLM_FUNC_QUALIFIER genType atanh(genType x) { GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atanh' only accept floating-point input"); From 76fce773373c936c7dbe14849236f62944c9eda7 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 15 Jul 2016 23:49:20 +0200 Subject: [PATCH 3/4] - Updated list of compiler versions detected --- glm/detail/setup.hpp | 39 ++++++++++++++++++++++++++++---- readme.md | 1 + test/core/core_setup_message.cpp | 27 ++++++++++++++++++++++ 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 7592b4bd..d176d832 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -152,7 +152,14 @@ #define GLM_COMPILER_GCC51 0x02000300 #define GLM_COMPILER_GCC52 0x02000400 #define GLM_COMPILER_GCC53 0x02000500 -#define GLM_COMPILER_GCC60 0x02000600 +#define GLM_COMPILER_GCC54 0x02000600 +#define GLM_COMPILER_GCC60 0x02000700 +#define GLM_COMPILER_GCC61 0x02000800 +#define GLM_COMPILER_GCC62 0x02000900 +#define GLM_COMPILER_GCC70 0x02000A00 +#define GLM_COMPILER_GCC71 0x02000B00 +#define GLM_COMPILER_GCC72 0x02000C00 +#define GLM_COMPILER_GCC80 0x02000D00 // CUDA #define GLM_COMPILER_CUDA 0x10000000 @@ -164,6 +171,7 @@ #define GLM_COMPILER_CUDA65 0x10000090 #define GLM_COMPILER_CUDA70 0x100000A0 #define GLM_COMPILER_CUDA75 0x100000B0 +#define GLM_COMPILER_CUDA80 0x100000C0 // LLVM #define GLM_COMPILER_LLVM 0x20000000 @@ -185,6 +193,9 @@ #define GLM_COMPILER_APPLE_CLANG51 0x40000050 #define GLM_COMPILER_APPLE_CLANG60 0x40000060 #define GLM_COMPILER_APPLE_CLANG61 0x40000070 +#define GLM_COMPILER_APPLE_CLANG70 0x40000080 +#define GLM_COMPILER_APPLE_CLANG73 0x40000090 +#define GLM_COMPILER_APPLE_CLANG80 0x400000A0 // Build model #define GLM_MODEL_32 0x00000010 @@ -255,8 +266,12 @@ # define GLM_COMPILER GLM_COMPILER_APPLE_CLANG60 # elif __clang_major__ == 6 && __clang_minor__ >= 1 # define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61 -# elif __clang_major__ >= 7 -# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG61 +# elif __clang_major__ == 7 && __clang_minor__ == 0 +# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG70 +# elif __clang_major__ == 7 && __clang_minor__ >= 3 +# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG73 +# elif __clang_major__ >= 8 +# define GLM_COMPILER GLM_COMPILER_APPLE_CLANG80 # else # define GLM_COMPILER GLM_COMPILER_APPLE_CLANG # endif @@ -312,10 +327,24 @@ # define GLM_COMPILER (GLM_COMPILER_GCC51) # elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 2) # define GLM_COMPILER (GLM_COMPILER_GCC52) -# elif (__GNUC__ == 5) && (__GNUC_MINOR__ >= 3) +# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 3) # define GLM_COMPILER (GLM_COMPILER_GCC53) -# elif (__GNUC__ >= 6) +# elif (__GNUC__ == 5) && (__GNUC_MINOR__ >= 4) +# define GLM_COMPILER (GLM_COMPILER_GCC54) +# elif (__GNUC__ == 6) && (__GNUC_MINOR__ == 0) # define GLM_COMPILER (GLM_COMPILER_GCC60) +# elif (__GNUC__ == 6) && (__GNUC_MINOR__ == 1) +# define GLM_COMPILER (GLM_COMPILER_GCC61) +# elif (__GNUC__ == 6) && (__GNUC_MINOR__ >= 2) +# define GLM_COMPILER (GLM_COMPILER_GCC62) +# elif (__GNUC__ == 7) && (__GNUC_MINOR__ == 0) +# define GLM_COMPILER (GLM_COMPILER_GCC70) +# elif (__GNUC__ == 7) && (__GNUC_MINOR__ == 1) +# define GLM_COMPILER (GLM_COMPILER_GCC71) +# elif (__GNUC__ == 7) && (__GNUC_MINOR__ == 2) +# define GLM_COMPILER (GLM_COMPILER_GCC72) +# elif (__GNUC__ >= 8) +# define GLM_COMPILER (GLM_COMPILER_GCC80) # else # define GLM_COMPILER (GLM_COMPILER_GCC) # endif diff --git a/readme.md b/readme.md index c064ef38..0d6b0080 100644 --- a/readme.md +++ b/readme.md @@ -54,6 +54,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) #### [GLM 0.9.7.6](https://github.com/g-truc/glm/tree/0.9.7) - 2016-0X-XX ##### Improvements: - Added pkg-config file #509 +- Updated list of compiler versions detected ##### Fixes: - Fixed STL for C++11 detection on ICC #510 diff --git a/test/core/core_setup_message.cpp b/test/core/core_setup_message.cpp index 3808dece..dae99c8e 100644 --- a/test/core/core_setup_message.cpp +++ b/test/core/core_setup_message.cpp @@ -71,9 +71,30 @@ int test_compiler() case GLM_COMPILER_GCC53: std::printf("GLM_COMPILER_GCC53\n"); break; + case GLM_COMPILER_GCC54: + std::printf("GLM_COMPILER_GCC54\n"); + break; case GLM_COMPILER_GCC60: std::printf("GLM_COMPILER_GCC60\n"); break; + case GLM_COMPILER_GCC61: + std::printf("GLM_COMPILER_GCC61\n"); + break; + case GLM_COMPILER_GCC62: + std::printf("GLM_COMPILER_GCC62\n"); + break; + case GLM_COMPILER_GCC70: + std::printf("GLM_COMPILER_GCC70\n"); + break; + case GLM_COMPILER_GCC71: + std::printf("GLM_COMPILER_GCC71\n"); + break; + case GLM_COMPILER_GCC72: + std::printf("GLM_COMPILER_GCC72\n"); + break; + case GLM_COMPILER_GCC80: + std::printf("GLM_COMPILER_GCC80\n"); + break; default: std::printf("GCC version not detected\n"); Error += 1; @@ -109,6 +130,12 @@ int test_compiler() case GLM_COMPILER_APPLE_CLANG61: std::printf("GLM_COMPILER_APPLE_CLANG61\n"); break; + case GLM_COMPILER_APPLE_CLANG70: + std::printf("GLM_COMPILER_APPLE_CLANG70\n"); + break; + case GLM_COMPILER_APPLE_CLANG73: + std::printf("GLM_COMPILER_APPLE_CLANG73\n"); + break; default: std::printf("Apple Clang version not detected\n"); break; From 208760661142d45a862e1dd79aafe23f50d05de8 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sat, 16 Jul 2016 00:28:32 +0200 Subject: [PATCH 4/4] - Improved C++ 11 STL detection #523 --- glm/detail/setup.hpp | 11 ++--------- readme.md | 1 + 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index d176d832..1464e848 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -681,15 +681,8 @@ // http://gcc.gnu.org/projects/cxx0x.html // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx -#if GLM_PLATFORM == GLM_PLATFORM_ANDROID || GLM_PLATFORM == GLM_PLATFORM_CYGWIN -# define GLM_HAS_CXX11_STL 0 -#elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) -# if __has_include(<__config>) // libc++ -# include <__config> -//# else // libstdc++ -//# include -# endif -# if defined(_LIBCPP_VERSION)// || defined(__GLIBCXX__) +#if GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) +# if defined(_LIBCPP_VERSION) && GLM_LANG & GLM_LANG_CXX11_FLAG # define GLM_HAS_CXX11_STL 1 # else # define GLM_HAS_CXX11_STL 0 diff --git a/readme.md b/readme.md index 0d6b0080..c318b4fb 100644 --- a/readme.md +++ b/readme.md @@ -55,6 +55,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate) ##### Improvements: - Added pkg-config file #509 - Updated list of compiler versions detected +- Improved C++ 11 STL detection #523 ##### Fixes: - Fixed STL for C++11 detection on ICC #510