Skip to content

Commit 737862f

Browse files
committed
[Fix] mpt/check/compiler.hpp: Fix exception detection on Clang-cl and generic compilers.
git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@22963 56274372-70c3-4bfc-bfc3-4c3a0b034d27
1 parent ed07b2c commit 737862f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mpt/check/compiler.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,15 @@ MPT_WARNING("C++ compiler has no exception support.")
4747
MPT_WARNING("C++ compiler has no exception support.")
4848
#endif
4949
#elif MPT_COMPILER_CLANG
50-
#if (!defined(__EXCEPTIONS) || (__EXCEPTIONS != 1))
50+
#if (!__has_feature(cxx_exceptions) && (!defined(__EXCEPTIONS) || (__EXCEPTIONS != 1)) && !defined(_CPPUNWIND))
51+
MPT_WARNING("C++ compiler has no exception support.")
52+
#else
53+
#if (MPT_CXX_AT_LEAST(20) && !defined(__cpp_exceptions))
5154
MPT_WARNING("C++ compiler has no exception support.")
5255
#endif
5356
#endif
5457
#endif
58+
#endif
5559

5660
#ifndef MPT_CHECK_CXX_IGNORE_WARNING_NO_RTTI
5761
#if MPT_COMPILER_MSVC

0 commit comments

Comments
 (0)