Enable the constexpr define on all compilers except gcc 4.9

0.8
Bruno Van de Velde 2017-08-31 01:17:07 +02:00
parent a1a5c89bd2
commit 2de9c4786b
1 changed files with 8 additions and 4 deletions

View File

@ -70,11 +70,15 @@
#define TGUI_VERSION_MINOR 8
#define TGUI_VERSION_PATCH 0
// The constexpr keyword is not widely supported enough to be enabled by default
#ifdef TGUI_ENABLE_CONSTEXPR
#define TGUI_CONSTEXPR constexpr
// All supported compilers except GCC 4.9 support constexpr
#if __GNUC__
#if __cpp_constexpr >= 201304
#define TGUI_CONSTEXPR constexpr
#else
#define TGUI_CONSTEXPR
#endif
#else
#define TGUI_CONSTEXPR
#define TGUI_CONSTEXPR constexpr
#endif
#endif // TGUI_CONFIG_HPP