mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Add workarounds for g++ 4.9
This commit is contained in:
parent
670ffbeb11
commit
eae7c21177
@ -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 */
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user