[libcxx-commits] [libcxxabi] b23fc2c - [libc++abi] Fix broken check for _LIBCPP_HAS_THREAD_API_PTHREAD (#118999)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 6 12:30:06 PST 2024


Author: Louis Dionne
Date: 2024-12-06T15:30:02-05:00
New Revision: b23fc2c5bf92ae3bcd2ac4c784ead0ffba159f5a

URL: https://github.com/llvm/llvm-project/commit/b23fc2c5bf92ae3bcd2ac4c784ead0ffba159f5a
DIFF: https://github.com/llvm/llvm-project/commit/b23fc2c5bf92ae3bcd2ac4c784ead0ffba159f5a.diff

LOG: [libc++abi] Fix broken check for _LIBCPP_HAS_THREAD_API_PTHREAD (#118999)

We were still using the old `defined(_LIBCPP_HAS_THREAD_API_PTHREAD)`
check, which is always true.

Added: 
    

Modified: 
    libcxxabi/src/cxa_guard_impl.h

Removed: 
    


################################################################################
diff  --git a/libcxxabi/src/cxa_guard_impl.h b/libcxxabi/src/cxa_guard_impl.h
index 7b05bf32f3eda7..191a589176b1a3 100644
--- a/libcxxabi/src/cxa_guard_impl.h
+++ b/libcxxabi/src/cxa_guard_impl.h
@@ -156,12 +156,12 @@ class AtomicInt {
 //                       PlatformGetThreadID
 //===----------------------------------------------------------------------===//
 
-#if defined(__APPLE__) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#if defined(__APPLE__) && _LIBCPP_HAS_THREAD_API_PTHREAD
 uint32_t PlatformThreadID() {
   static_assert(sizeof(mach_port_t) == sizeof(uint32_t), "");
   return static_cast<uint32_t>(pthread_mach_thread_np(std::__libcpp_thread_get_current_id()));
 }
-#elif defined(SYS_gettid) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
+#elif defined(SYS_gettid) && _LIBCPP_HAS_THREAD_API_PTHREAD
 uint32_t PlatformThreadID() {
   static_assert(sizeof(pid_t) == sizeof(uint32_t), "");
   return static_cast<uint32_t>(syscall(SYS_gettid));


        


More information about the libcxx-commits mailing list