Skip to content

Commit

Permalink
Updated support for gcc 4.7 in C++11 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Małecki authored and rndi committed Aug 12, 2019
1 parent c46cf08 commit 19d18f0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions srtcore/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,24 @@ written by
#endif

#if defined(__cplusplus) && __cplusplus > 199711L
#define HAVE_CXX11 1
#define HAVE_FULL_CXX11 1
#define ATR_NOEXCEPT noexcept
#define ATR_CONSTEXPR constexpr
#define ATR_OVERRIDE override
#define ATR_FINAL final

// For gcc 4.7, claim C++11 is supported, as long as experimental C++0x is on,
// however it's only the "most required C++11 support".
#elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC_MINOR__ >= 7 // 4.7 only!
#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC_MAJOR__ == 4 && __GNUC_MINOR__ >= 7 // 4.7 only!
#define HAVE_CXX11 1
#define ATR_NOEXCEPT
#define ATR_CONSTEXPR
#define ATR_OVERRIDE
#define ATR_FINAL
#else
#define HAVE_CXX11 1
#define HAVE_FULL_CXX11 1
#define ATR_NOEXCEPT noexcept
#define ATR_CONSTEXPR constexpr
#define ATR_OVERRIDE override
#define ATR_FINAL final
#endif


// Microsoft Visual Studio supports C++11, but not fully,
// and still did not change the value of __cplusplus. Treat
Expand All @@ -49,6 +52,7 @@ written by
#elif defined(_MSC_VER) && _MSC_VER >= 1800
#define HAVE_CXX11 1
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026
#define HAVE_FULL_CXX11 1
#define ATR_NOEXCEPT noexcept
#define ATR_CONSTEXPR constexpr
#define ATR_OVERRIDE override
Expand Down

0 comments on commit 19d18f0

Please sign in to comment.