Skip to content

Commit b23fc2c

Browse files
authored
[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.
1 parent 1df2855 commit b23fc2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxxabi/src/cxa_guard_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ class AtomicInt {
156156
// PlatformGetThreadID
157157
//===----------------------------------------------------------------------===//
158158

159-
#if defined(__APPLE__) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
159+
#if defined(__APPLE__) && _LIBCPP_HAS_THREAD_API_PTHREAD
160160
uint32_t PlatformThreadID() {
161161
static_assert(sizeof(mach_port_t) == sizeof(uint32_t), "");
162162
return static_cast<uint32_t>(pthread_mach_thread_np(std::__libcpp_thread_get_current_id()));
163163
}
164-
#elif defined(SYS_gettid) && defined(_LIBCPP_HAS_THREAD_API_PTHREAD)
164+
#elif defined(SYS_gettid) && _LIBCPP_HAS_THREAD_API_PTHREAD
165165
uint32_t PlatformThreadID() {
166166
static_assert(sizeof(pid_t) == sizeof(uint32_t), "");
167167
return static_cast<uint32_t>(syscall(SYS_gettid));

0 commit comments

Comments
 (0)