fix: __STDC_VERSION__ can be undefined in C++
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 17 Mar 2022 17:45:51 +0000 (13:45 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 22 Mar 2022 19:37:44 +0000 (15:37 -0400)
Caught on SLES12 with g++ 4.8 when enabling '-Wundef'.

Change-Id: Ib027f224a4f0ef021beb1709d8a626db62fe6d9c
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-compiler.h
tests/utils/tap.h

index 51491a5f1628f44b79252df8aa71e95b44c3338c..b7fd2c1c42bff2bac5d6bfc1c4f403a61fa82234 100644 (file)
@@ -68,7 +68,7 @@
 #ifdef __cplusplus
 #define lttng_ust_static_assert(predicate, msg, c_identifier_msg)  \
        static_assert(predicate, msg)
-#elif __STDC_VERSION__ >= 201112L
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
 #define lttng_ust_static_assert(predicate, msg, c_identifier_msg)  \
        _Static_assert(predicate, msg)
 #else
index 60455a07bd9fefa50d58de5fa563b67bdb4e59ff..f9f423ee22948a8a3085832b6a20e108ed9f3b7c 100644 (file)
@@ -28,7 +28,7 @@
                        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__) :                         \
This page took 0.031417 seconds and 4 git commands to generate.