From 88e963b936b96f9e262d4642377f26fd6fabc9ac Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 9 Jun 2017 20:36:45 +0200 Subject: [PATCH] Fix compilation errors in GCC 4.6 and 4.8 --- dtool/src/dtoolbase/dtoolbase_cc.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase_cc.h b/dtool/src/dtoolbase/dtoolbase_cc.h index 88d4244af6..cd6e76b4fe 100644 --- a/dtool/src/dtoolbase/dtoolbase_cc.h +++ b/dtool/src/dtoolbase/dtoolbase_cc.h @@ -178,12 +178,6 @@ template typename remove_reference::type &&move(T &&t) { # endif #elif defined(__GNUC__) && (__cplusplus >= 201103L) // GCC -// GCC defines several macros which we can query. List of all supported -// builtin macros: https://gcc.gnu.org/projects/cxx-status.html -# if __cpp_constexpr >= 200704 -# define CONSTEXPR constexpr -# endif - // Starting at GCC 4.4 # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) # define DEFAULT_CTOR = default @@ -194,6 +188,7 @@ template typename remove_reference::type &&move(T &&t) { // Starting at GCC 4.6 # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +# define CONSTEXPR constexpr # define NOEXCEPT noexcept # define USE_MOVE_SEMANTICS # define FINAL final @@ -205,6 +200,12 @@ template typename remove_reference::type &&move(T &&t) { # define OVERRIDE override # endif +// GCC defines several macros which we can query. List of all supported +// builtin macros: https://gcc.gnu.org/projects/cxx-status.html +# if !defined(CONSTEXPR) && __cpp_constexpr >= 200704 +# define CONSTEXPR constexpr +# endif + #elif defined(_MSC_VER) && _MSC_VER >= 1900 // Visual Studio 2015 # define CONSTEXPR constexpr # define NOEXCEPT noexcept