Skip to content

Commit 06adf55

Browse files
author
Jordan Maples
committed
update kernel mode detection macro
1 parent ce4d689 commit 06adf55

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/gsl/gsl_assert

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// Temporary until MSVC STL supports no-exceptions mode.
2222
// Currently terminate is a no-op in this mode, so we add termination behavior back
2323
//
24-
#if defined(_MSC_VER) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS
24+
#if defined(_MSC_VER) && (defined(_KERNEL_MODE) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS))
2525

2626
#define GSL_MSVC_USE_STL_NOEXCEPTION_WORKAROUND
2727
#include <intrin.h>
@@ -31,9 +31,12 @@
3131
#pragma clang diagnostic push
3232
#pragma clang diagnostic ignored "-Winvalid-noreturn"
3333
#endif // defined(__clang__)
34-
#else
34+
35+
#else // defined(_MSC_VER) && (defined(_KERNEL_MODE) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS))
36+
3537
#include <exception>
36-
#endif // !defined(_MSC_VER) || !defined(_HAS_EXCEPTIONS) || _HAS_EXCEPTIONS
38+
39+
#endif // defined(_MSC_VER) && (defined(_KERNEL_MODE) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS))
3740

3841
//
3942
// make suppress attributes parse for some compilers

0 commit comments

Comments
 (0)