Skip to content

Commit

Permalink
[libc++] NFC: only fwd-declare ABI-functions in exception_ptr.h condi…
Browse files Browse the repository at this point in the history
…tionally

This patch fixes the unconditional fodward-declarations of ABI-functions in
exception_ptr.h, and makes it dependendent on the availability macro, as it
should've been from the beginning.
The declarations being unconditional break the build with libcxxrt
before 045c52ce821388f4ae4d119fe4fb75f1eb547b85, now the are opt-out.

* libcxx/include/__exception/exception_ptr.h
  Only forward-declare ABI-functions if they are meant to be used.
  • Loading branch information
itrofimow committed Mar 11, 2024
1 parent edd4c6c commit 9daa1b3
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 9daa1b3

Please sign in to comment.