From: Michael Jeanson Date: Wed, 16 Mar 2022 15:46:49 +0000 (-0400) Subject: Clean-up: fix '-Wundef' warnings on various platforms X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f3af9f34ce10b8eb2c99541b1adce9bb0ac16998;p=lttng-tools.git Clean-up: fix '-Wundef' warnings on various platforms Change-Id: I8dfffd2ad5eb55a0b8fe74d29a82a224da19f30a Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/compat/poll.h b/src/common/compat/poll.h index 8e99a3150..f9fb33fc9 100644 --- a/src/common/compat/poll.h +++ b/src/common/compat/poll.h @@ -235,7 +235,7 @@ enum { LPOLLRDBAND = POLLRDBAND, LPOLLWRNORM = POLLWRNORM, LPOLLWRBAND = POLLWRBAND, -#if __linux__ +#ifdef __linux__ LPOLLMSG = POLLMSG, LPOLLRDHUP = POLLRDHUP, #elif (defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__sun__) || defined(__APPLE__)) diff --git a/tests/utils/tap/tap.h b/tests/utils/tap/tap.h index bba1ceadc..bc6745a73 100644 --- a/tests/utils/tap/tap.h +++ b/tests/utils/tap/tap.h @@ -32,7 +32,7 @@ extern "C" { skip(n, fmt, ## __VA_ARGS__); \ continue; \ } -#elif __STDC_VERSION__ >= 199901L /* __GNUC__ */ +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* __GNUC__ */ # define ok(e, ...) ((e) ? \ _gen_result(1, __func__, __FILE__, __LINE__, \ __VA_ARGS__) : \ diff --git a/tests/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack.c b/tests/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack.c index c7340cb14..9d3e030b7 100644 --- a/tests/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack.c +++ b/tests/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack.c @@ -45,7 +45,7 @@ my_gettid(void) : "0"(__NR_gettid) : "cc", "rcx", "r11", "memory" ); -#elif __i386 +#elif defined(__i386) asm volatile ( "int $0x80"