Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++abi] Fix broken check for _LIBCPP_HAS_THREAD_API_PTHREAD #118999

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Dec 6, 2024

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

We were still using the old `defined(_LIBCPP_HAS_THREAD_API_PTHREAD)`
check, which is always true.
@ldionne ldionne requested a review from a team as a code owner December 6, 2024 16:43
@ldionne
Copy link
Member Author

ldionne commented Dec 6, 2024

CC @philnik777

@llvmbot llvmbot added the libc++abi libc++abi C++ Runtime Library. Not libc++. label Dec 6, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 6, 2024

@llvm/pr-subscribers-libcxxabi

Author: Louis Dionne (ldionne)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/118999.diff

1 Files Affected:

  • (modified) libcxxabi/src/cxa_guard_impl.h (+2-2)
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));

@ldionne ldionne merged commit b23fc2c into llvm:main Dec 6, 2024
59 of 63 checks passed
@ldionne ldionne deleted the review/fix-thread-api-conditional branch December 6, 2024 20:30
broxigarchen pushed a commit to broxigarchen/llvm-project that referenced this pull request Dec 10, 2024
…#118999)

We were still using the old `defined(_LIBCPP_HAS_THREAD_API_PTHREAD)`
check, which is always true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++abi libc++abi C++ Runtime Library. Not libc++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants