|
94 | 94 | #define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor)
|
95 | 95 | #endif
|
96 | 96 |
|
97 |
| -/* Features that were introduced in C++14 */ |
98 |
| -#if TEST_STD_VER >= 14 |
99 |
| -#define TEST_HAS_EXTENDED_CONSTEXPR |
100 |
| -#define TEST_HAS_VARIABLE_TEMPLATES |
101 |
| -#endif |
102 |
| - |
103 |
| -/* Features that were introduced after C++14 */ |
104 |
| -#if TEST_STD_VER > 14 |
105 |
| -#endif |
106 |
| - |
107 | 97 | #if TEST_STD_VER >= 11
|
108 | 98 | #define TEST_ALIGNOF(...) alignof(__VA_ARGS__)
|
109 | 99 | #define TEST_ALIGNAS(...) alignas(__VA_ARGS__)
|
|
132 | 122 | #define TEST_THROW_SPEC(...) throw(__VA_ARGS__)
|
133 | 123 | #endif
|
134 | 124 |
|
| 125 | +// Sniff out to see if the underling C library has C11 features |
| 126 | +// Note that at this time (July 2018), MacOS X and iOS do NOT. |
| 127 | +#if __ISO_C_VISIBLE >= 2011 |
| 128 | +# if defined(__FreeBSD__) |
| 129 | +# define TEST_HAS_C11_FEATURES |
| 130 | +# elif defined(__Fuchsia__) |
| 131 | +# define TEST_HAS_C11_FEATURES |
| 132 | +# elif defined(__linux__) |
| 133 | +# if !defined(_LIBCPP_HAS_MUSL_LIBC) |
| 134 | +# if _LIBCPP_GLIBC_PREREQ(2, 17) |
| 135 | +# define TEST_HAS_C11_FEATURES |
| 136 | +# endif |
| 137 | +# else // defined(_LIBCPP_HAS_MUSL_LIBC) |
| 138 | +# define TEST_HAS_C11_FEATURES |
| 139 | +# endif |
| 140 | +# elif defined(_WIN32) |
| 141 | +# if defined(_MSC_VER) && !defined(__MINGW32__) |
| 142 | +# define TEST_HAS_C11_FEATURES // Using Microsoft's C Runtime library |
| 143 | +# endif |
| 144 | +# endif |
| 145 | +#endif |
| 146 | + |
| 147 | +/* Features that were introduced in C++14 */ |
| 148 | +#if TEST_STD_VER >= 14 |
| 149 | +#define TEST_HAS_EXTENDED_CONSTEXPR |
| 150 | +#define TEST_HAS_VARIABLE_TEMPLATES |
| 151 | +#endif |
| 152 | + |
| 153 | +/* Features that were introduced in C++17 */ |
| 154 | +#if TEST_STD_VER >= 17 |
| 155 | +#endif |
| 156 | + |
| 157 | +/* Features that were introduced after C++17 */ |
| 158 | +#if TEST_STD_VER > 17 |
| 159 | +#endif |
| 160 | + |
| 161 | + |
135 | 162 | #define TEST_ALIGNAS_TYPE(...) TEST_ALIGNAS(TEST_ALIGNOF(__VA_ARGS__))
|
136 | 163 |
|
137 | 164 | #if !TEST_HAS_FEATURE(cxx_rtti) && !defined(__cpp_rtti) \
|
|
0 commit comments