-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[LLVM] Check if LLVM_ON_UNIX is Defined #166827
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
Merged
boomanaiden154
merged 1 commit into
main
from
users/boomanaiden154/llvm-check-of-llvm_on_unix-is-defined
Nov 6, 2025
Merged
[LLVM] Check if LLVM_ON_UNIX is Defined #166827
boomanaiden154
merged 1 commit into
main
from
users/boomanaiden154/llvm-check-of-llvm_on_unix-is-defined
Nov 6, 2025
+2
−2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created using spr 1.3.7
|
@llvm/pr-subscribers-llvm-support Author: Aiden Grossman (boomanaiden154) ChangesThis is canonical in the rest of the repository and otherwise we can end Full diff: https://github.com/llvm/llvm-project/pull/166827.diff 1 Files Affected:
diff --git a/llvm/include/llvm/Support/thread.h b/llvm/include/llvm/Support/thread.h
index ecde62d8368e7..51873e7d529bf 100644
--- a/llvm/include/llvm/Support/thread.h
+++ b/llvm/include/llvm/Support/thread.h
@@ -34,7 +34,7 @@ typedef PVOID HANDLE;
namespace llvm {
-#if LLVM_ON_UNIX || _WIN32
+#if defined(LLVM_ON_UNIX) || defined(_WIN32)
/// LLVM thread following std::thread interface with added constructor to
/// specify stack size.
@@ -49,7 +49,7 @@ class thread {
}
public:
-#if LLVM_ON_UNIX
+#ifdef LLVM_ON_UNIX
using native_handle_type = pthread_t;
using id = pthread_t;
using start_routine_type = void *(*)(void *);
|
boomanaiden154
added a commit
to boomanaiden154/llvm-project
that referenced
this pull request
Nov 6, 2025
This is canonical in the rest of the repository and otherwise we can end up with warnings when compiling with clang-cl on Windows that look like the following: ``` 2025-11-06T17:55:25.2412502Z C:\_work\llvm-project\llvm-project\llvm\include\llvm/Support/thread.h(37,5): warning: 'LLVM_ON_UNIX' is not defined, evaluates to 0 [-Wundef] 2025-11-06T17:55:25.2413436Z 37 | #if LLVM_ON_UNIX || _WIN32 2025-11-06T17:55:25.2413791Z | ^ 2025-11-06T17:55:25.2414625Z C:\_work\llvm-project\llvm-project\llvm\include\llvm/Support/thread.h(52,5): warning: 'LLVM_ON_UNIX' is not defined, evaluates to 0 [-Wundef] 2025-11-06T17:55:25.2415585Z 52 | #if LLVM_ON_UNIX 2025-11-06T17:55:25.2415901Z | ^ 2025-11-06T17:55:25.2416169Z 2 warnings generated. ``` Pull Request: llvm#166827
boomanaiden154
added a commit
to boomanaiden154/llvm-project
that referenced
this pull request
Nov 6, 2025
This is canonical in the rest of the repository and otherwise we can end up with warnings when compiling with clang-cl on Windows that look like the following: ``` 2025-11-06T17:55:25.2412502Z C:\_work\llvm-project\llvm-project\llvm\include\llvm/Support/thread.h(37,5): warning: 'LLVM_ON_UNIX' is not defined, evaluates to 0 [-Wundef] 2025-11-06T17:55:25.2413436Z 37 | #if LLVM_ON_UNIX || _WIN32 2025-11-06T17:55:25.2413791Z | ^ 2025-11-06T17:55:25.2414625Z C:\_work\llvm-project\llvm-project\llvm\include\llvm/Support/thread.h(52,5): warning: 'LLVM_ON_UNIX' is not defined, evaluates to 0 [-Wundef] 2025-11-06T17:55:25.2415585Z 52 | #if LLVM_ON_UNIX 2025-11-06T17:55:25.2415901Z | ^ 2025-11-06T17:55:25.2416169Z 2 warnings generated. ``` Pull Request: llvm#166827
cachemeifyoucan
approved these changes
Nov 6, 2025
llvm-sync bot
pushed a commit
to arm/arm-toolchain
that referenced
this pull request
Nov 6, 2025
This is canonical in the rest of the repository and otherwise we can end up with warnings when compiling with clang-cl on Windows that look like the following: ``` 2025-11-06T17:55:25.2412502Z C:\_work\llvm-project\llvm-project\llvm\include\llvm/Support/thread.h(37,5): warning: 'LLVM_ON_UNIX' is not defined, evaluates to 0 [-Wundef] 2025-11-06T17:55:25.2413436Z 37 | #if LLVM_ON_UNIX || _WIN32 2025-11-06T17:55:25.2413791Z | ^ 2025-11-06T17:55:25.2414625Z C:\_work\llvm-project\llvm-project\llvm\include\llvm/Support/thread.h(52,5): warning: 'LLVM_ON_UNIX' is not defined, evaluates to 0 [-Wundef] 2025-11-06T17:55:25.2415585Z 52 | #if LLVM_ON_UNIX 2025-11-06T17:55:25.2415901Z | ^ 2025-11-06T17:55:25.2416169Z 2 warnings generated. ``` Reviewers: joker-eph, pcc, cachemeifyoucan Reviewed By: cachemeifyoucan Pull Request: llvm/llvm-project#166827
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is canonical in the rest of the repository and otherwise we can end
up with warnings when compiling with clang-cl on Windows that look like
the following: