Skip to content

Commit c6a61d8

Browse files
committed
Merge #149: Avoid -Wundef compiler warnings
d450fbf Avoid `-Wundef` compiler warnings (Hennadii Stepanov) Pull request description: Fixes bitcoin/bitcoin#30975 (comment): > On my own macOS 15.3 with Xcode 16.2 machine building fails: > > ``` > git clean -dfx > cmake -B build -DENABLE_IPC=ON > cmake --build build > ... > /Users/sjors/dev/bitcoin/src/ipc/libmultiprocess/src/mp/util.cpp:22:5: error: '__linux__' is not defined, evaluates to 0 [-Werror,-Wundef] > 22 | #if __linux__ > | ^ > /Users/sjors/dev/bitcoin/src/ipc/libmultiprocess/src/mp/util.cpp:62:5: error: '__linux__' is not defined, evaluates to 0 [-Werror,-Wundef] > 62 | #if __linux__ > | ^ > 2 errors generated. > ``` ACKs for top commit: ryanofsky: Code review ACK d450fbf Tree-SHA512: db7de0f43d568854d8ad1c88370de28d3d96bd55ca745852ef0adb51f427fb7f6f675af1a2baa8278c3ebcddcc27edf3f0c7c364b98ffc1d01c30f10a48bcbb8
2 parents c978878 + d450fbf commit c6a61d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mp/util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <thread>
2020
#include <unistd.h>
2121

22-
#if __linux__
22+
#ifdef __linux__
2323
#include <syscall.h>
2424
#endif
2525

@@ -59,7 +59,7 @@ std::string ThreadName(const char* exe_name)
5959

6060
// Prefer platform specific thread ids over the standard C++11 ones because
6161
// the former are shorter and are the same as what gdb prints "LWP ...".
62-
#if __linux__
62+
#ifdef __linux__
6363
buffer << syscall(SYS_gettid);
6464
#elif defined(HAVE_PTHREAD_THREADID_NP)
6565
uint64_t tid = 0;

0 commit comments

Comments
 (0)