Skip to content

Commit f46e239

Browse files
boomanaiden154github-actions[bot]
authored andcommitted
Automerge: [LLVM] Check if LLVM_ON_UNIX is Defined
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
2 parents 24cd204 + ad723f9 commit f46e239

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/Support/thread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ typedef PVOID HANDLE;
3434

3535
namespace llvm {
3636

37-
#if LLVM_ON_UNIX || _WIN32
37+
#if defined(LLVM_ON_UNIX) || defined(_WIN32)
3838

3939
/// LLVM thread following std::thread interface with added constructor to
4040
/// specify stack size.
@@ -49,7 +49,7 @@ class thread {
4949
}
5050

5151
public:
52-
#if LLVM_ON_UNIX
52+
#ifdef LLVM_ON_UNIX
5353
using native_handle_type = pthread_t;
5454
using id = pthread_t;
5555
using start_routine_type = void *(*)(void *);

0 commit comments

Comments
 (0)