Skip to content

Commit

Permalink
[libc++] Only forward-declare ABI-functions in exception_ptr.h if the…
Browse files Browse the repository at this point in the history
…y are meant to be used (#84707)

This patch fixes the unconditional forward-declarations of ABI-functions
in exception_ptr.h, and makes it dependent on the availability macro, as
it should've been from the beginning.

The declarations being unconditional break the build with libcxxrt
before 045c52ce8 [1], now they are opt-out.

[1]: libcxxrt/libcxxrt@045c52c
  • Loading branch information
itrofimow authored Mar 11, 2024
1 parent 63c77d8 commit 63af858
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libcxx/include/__exception/exception_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#ifndef _LIBCPP_ABI_MICROSOFT

# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION

namespace __cxxabiv1 {

extern "C" {
Expand All @@ -37,14 +39,16 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception(
void*,
std::type_info*,
void(
# if defined(_WIN32)
# if defined(_WIN32)
__thiscall
# endif
# endif
*)(void*)) throw();
}

} // namespace __cxxabiv1

# endif

#endif

namespace std { // purposefully not using versioning namespace
Expand Down

0 comments on commit 63af858

Please sign in to comment.