Move __cpp_constexpr check inside Q_COMPILER_CONSTEXPR check

Q_COMPILER_CONSTEXPR can be undefined (or not defined at all) to
indicate that constexpr should not be used regardless of the compiler's
ability to support it.  This is done for QNX because some C library
floating point functions used in the Dinkumware C++ library aren't
constexpr functions; i.e., the library doesn't have proper constexpr
support even though the compiler does.

Change-Id: I16918bbceac1e20b67c6ddbda28df3d9758bab83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
James McDonnell 2016-02-11 10:10:21 -05:00
parent 1da975cdc5
commit d87242968f
1 changed files with 12 additions and 10 deletions

View File

@ -1013,16 +1013,18 @@
# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
#endif
#if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304
# define Q_DECL_CONSTEXPR constexpr
# define Q_DECL_RELAXED_CONSTEXPR constexpr
# define Q_CONSTEXPR constexpr
# define Q_RELAXED_CONSTEXPR constexpr
#elif defined Q_COMPILER_CONSTEXPR
# define Q_DECL_CONSTEXPR constexpr
# define Q_DECL_RELAXED_CONSTEXPR
# define Q_CONSTEXPR constexpr
# define Q_RELAXED_CONSTEXPR const
#if defined Q_COMPILER_CONSTEXPR
# if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304
# define Q_DECL_CONSTEXPR constexpr
# define Q_DECL_RELAXED_CONSTEXPR constexpr
# define Q_CONSTEXPR constexpr
# define Q_RELAXED_CONSTEXPR constexpr
# else
# define Q_DECL_CONSTEXPR constexpr
# define Q_DECL_RELAXED_CONSTEXPR
# define Q_CONSTEXPR constexpr
# define Q_RELAXED_CONSTEXPR const
# endif
#else
# define Q_DECL_CONSTEXPR
# define Q_DECL_RELAXED_CONSTEXPR