Add workarounds for g++ 4.9

This commit is contained in:
Nicholas Guarracino 2015-11-12 16:23:37 -05:00
parent 670ffbeb11
commit eae7c21177
2 changed files with 13 additions and 0 deletions

View File

@ -45,6 +45,10 @@
#endif // _MSC_VER #endif // _MSC_VER
#if (__GNUC__ < 5) && !defined(__clang__)
#define constexpr /* nothing */
#endif
// In order to test the library, we need it to throw exceptions that we can catch // In order to test the library, we need it to throw exceptions that we can catch
#ifdef GSL_THROWS_FOR_TESTING #ifdef GSL_THROWS_FOR_TESTING
#define noexcept /* nothing */ #define noexcept /* nothing */

View File

@ -60,6 +60,10 @@
#endif // _MSC_VER #endif // _MSC_VER
#if (__GNUC__ < 5) && !defined(__clang__)
#define constexpr /* nothing */
#endif
// In order to test the library, we need it to throw exceptions that we can catch // In order to test the library, we need it to throw exceptions that we can catch
#ifdef GSL_THROWS_FOR_TESTING #ifdef GSL_THROWS_FOR_TESTING
#define noexcept /* nothing */ #define noexcept /* nothing */
@ -227,6 +231,9 @@ private:
#ifndef _MSC_VER #ifndef _MSC_VER
#if (__GNUC__ < 5) && !defined(__clang__)
const std::ptrdiff_t dynamic_range = -1;
#else
struct static_bounds_dynamic_range_t struct static_bounds_dynamic_range_t
{ {
template <typename T, typename Dummy = std::enable_if_t<std::is_integral<T>::value>> template <typename T, typename Dummy = std::enable_if_t<std::is_integral<T>::value>>
@ -262,6 +269,8 @@ constexpr bool operator !=(T left, static_bounds_dynamic_range_t right) noexcept
} }
constexpr static_bounds_dynamic_range_t dynamic_range{}; constexpr static_bounds_dynamic_range_t dynamic_range{};
#endif
#else #else
const std::ptrdiff_t dynamic_range = -1; const std::ptrdiff_t dynamic_range = -1;
#endif #endif