Skip to content

Commit 63af858

Browse files
authored
[libc++] Only forward-declare ABI-functions in exception_ptr.h if they 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
1 parent 63c77d8 commit 63af858

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libcxx/include/__exception/exception_ptr.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
#ifndef _LIBCPP_ABI_MICROSOFT
2828

29+
# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
30+
2931
namespace __cxxabiv1 {
3032

3133
extern "C" {
@@ -37,14 +39,16 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS __cxa_exception* __cxa_init_primary_exception(
3739
void*,
3840
std::type_info*,
3941
void(
40-
# if defined(_WIN32)
42+
# if defined(_WIN32)
4143
__thiscall
42-
# endif
44+
# endif
4345
*)(void*)) throw();
4446
}
4547

4648
} // namespace __cxxabiv1
4749

50+
# endif
51+
4852
#endif
4953

5054
namespace std { // purposefully not using versioning namespace

0 commit comments

Comments
 (0)