mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
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.
This commit is contained in:
parent
d267d109c3
commit
6928aac9da
1 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue