aboutsummaryrefslogtreecommitdiff
path: root/libcxx
diff options
context:
space:
mode:
authoritrofimow <i.trofimow@yandex.ru>2024-03-11 18:59:05 +0400
committerGitHub <noreply@github.com>2024-03-11 10:59:05 -0400
commit63af8584fc7ea81ef6f2176e0ada0533a3495745 (patch)
treed9d10ed0e23da89bd7bd644ef662b1acd9003106 /libcxx
parent63c77d84756793ad38e3a5b830a27b400308fe7a (diff)
downloadllvm-63af8584fc7ea81ef6f2176e0ada0533a3495745.zip
llvm-63af8584fc7ea81ef6f2176e0ada0533a3495745.tar.gz
llvm-63af8584fc7ea81ef6f2176e0ada0533a3495745.tar.bz2
[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]: https://github.com/libcxxrt/libcxxrt/commit/045c52ce821388f4ae4d119fe4fb75f1eb547b85
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/__exception/exception_ptr.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/libcxx/include/__exception/exception_ptr.h b/libcxx/include/__exception/exception_ptr.h
index 53e2f71..c9027de 100644
--- a/libcxx/include/__exception/exception_ptr.h
+++ b/libcxx/include/__exception/exception_ptr.h
@@ -26,6 +26,8 @@
#ifndef _LIBCPP_ABI_MICROSOFT
+# if _LIBCPP_AVAILABILITY_HAS_INIT_PRIMARY_EXCEPTION
+
namespace __cxxabiv1 {
extern "C" {
@@ -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