From 166ea80f669da8ce1019a814a966b76024ee2c16 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 18 Oct 2017 16:35:11 -0700 Subject: [PATCH] Update std::byte detection in gsl_byte for MSVC (#561) * Only check that `_HAS_STD_BYTE` is defined to a non-zero value --- include/gsl/gsl_byte | 6 +++--- tests/unittest-cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) create mode 160000 tests/unittest-cpp diff --git a/include/gsl/gsl_byte b/include/gsl/gsl_byte index 1e2e3be..7155210 100644 --- a/include/gsl/gsl_byte +++ b/include/gsl/gsl_byte @@ -30,15 +30,15 @@ #ifndef GSL_USE_STD_BYTE // this tests if we are under MSVC and the standard lib has std::byte and it is enabled -#if _MSC_VER >= 1911 && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE) +#if defined(_HAS_STD_BYTE) && _HAS_STD_BYTE #define GSL_USE_STD_BYTE 1 -#else // _MSC_VER >= 1911 && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE) +#else // defined(_HAS_STD_BYTE) && _HAS_STD_BYTE #define GSL_USE_STD_BYTE 0 -#endif // _MSC_VER >= 1911 && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE) +#endif // defined(_HAS_STD_BYTE) && _HAS_STD_BYTE #endif // GSL_USE_STD_BYTE #else // _MSC_VER diff --git a/tests/unittest-cpp b/tests/unittest-cpp new file mode 160000 index 0000000..dc6b908 --- /dev/null +++ b/tests/unittest-cpp @@ -0,0 +1 @@ +Subproject commit dc6b90838014ab985bf3cd74ac17ad9d00e1fbcb