aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2021-09-09 21:41:51 +0300
committerLasse Collin <lasse.collin@tukaani.org>2021-09-09 21:41:51 +0300
commit6928aac9da6ba612780b9f72ba1d6ecbe1e8b54e (patch)
treeafbbc5c853cebb4f84845b26caa48f83a3d86b53 /src
parentliblzma: Rename EROFS LZMA to MicroLZMA. (diff)
downloadxz-6928aac9da6ba612780b9f72ba1d6ecbe1e8b54e.tar.xz
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 <https://sourceforge.net/p/lzmautils/discussion/708858/thread/f6bc3b108a/>. Thanks to Dan Weiss.
Diffstat (limited to 'src')
-rw-r--r--src/liblzma/api/lzma.h3
1 files changed, 2 insertions, 1 deletions
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()