Skip to content

Commit 25d6bea

Browse files
committed
Merge pull request 1174 from riidefi/master
2 parents dcd711d + 000101d commit 25d6bea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cxx.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ inline namespace cxxbridge1 {
7676

7777
template <typename Exception>
7878
void panic [[noreturn]] (const char *msg) {
79-
#if defined(RUST_CXX_NO_EXCEPTIONS)
79+
// Do not attempt to throw if the compiler explicitly does not support it.
80+
// If __cpp_attributes is not set, the compiler may not implement feature-test macros.
81+
#if defined(RUST_CXX_NO_EXCEPTIONS) || (defined(__cpp_attributes) && !defined(__cpp_exceptions))
8082
std::fprintf(stderr, "Error: %s. Aborting.\n", msg);
8183
std::abort();
8284
#else

0 commit comments

Comments
 (0)