From d8b294af03840c7c47d6b7b0d4c0d6d2f6357dfa Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Thu, 9 Sep 2021 21:41:51 +0300 Subject: [PATCH] liblzma: Use _MSVC_LANG to detect when "noexcept" can be used with MSVC. By default, MSVC always sets __cplusplus to 199711L. The real C++ standard version is available in _MSVC_LANG (or one could use /Zc:__cplusplus to set __cplusplus correctly). Fixes . Thanks to Dan Weiss. --- src/liblzma/api/lzma.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/liblzma/api/lzma.h b/src/liblzma/api/lzma.h index 122dab80..8fbd9a87 100644 --- a/src/liblzma/api/lzma.h +++ b/src/liblzma/api/lzma.h @@ -219,7 +219,8 @@ */ #ifndef lzma_nothrow # if defined(__cplusplus) -# if __cplusplus >= 201103L +# if __cplusplus >= 201103L || (defined(_MSVC_LANG) \ + && _MSVC_LANG >= 201103L) # define lzma_nothrow noexcept # else # define lzma_nothrow throw()