mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
* Explicitly check for availbility of std::byte GCC > 7.3 defines __cpp_lib_byte >= 201603 when std::byte is available. On libc++ std::byte is available since version 5.0. This can be checked with _LIBCPP_VERSION >= 5000. This fixes 713. * Add missing \ in preprocessor check
This commit is contained in:
parent
f4a715816c
commit
b6c531f7c1
@ -43,16 +43,23 @@
|
||||
|
||||
#ifndef GSL_USE_STD_BYTE
|
||||
// this tests if we are under GCC or Clang with enough -std:c++1z power to get us std::byte
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
// also check if libc++ version is sufficient (> 5.0) or libstc++ actually contains std::byte
|
||||
#if defined(__cplusplus) && (__cplusplus >= 201703L) && \
|
||||
(defined(__cpp_lib_byte) && (__cpp_lib_byte >= 201603) || \
|
||||
defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 5000))
|
||||
|
||||
#define GSL_USE_STD_BYTE 1
|
||||
#include <cstddef>
|
||||
|
||||
#else // defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
#else // defined(__cplusplus) && (__cplusplus >= 201703L) &&
|
||||
// (defined(__cpp_lib_byte) && (__cpp_lib_byte >= 201603) ||
|
||||
// defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 5000))
|
||||
|
||||
#define GSL_USE_STD_BYTE 0
|
||||
|
||||
#endif //defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||
// (defined(__cpp_lib_byte) && (__cpp_lib_byte >= 201603) ||
|
||||
// defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 5000))
|
||||
#endif // GSL_USE_STD_BYTE
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
Loading…
Reference in New Issue
Block a user