summaryrefslogtreecommitdiff
path: root/src/basic/macro.h
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2018-03-15 06:23:46 +0100
committerSven Eden <yamakuzure@gmx.net>2018-06-28 09:23:09 +0200
commitfde3d03b393fa9429596449ea749b1de36a7b9e5 (patch)
treedaff2bbf3f7c1129141e62c3e3f0338aa92c0510 /src/basic/macro.h
parentc3227cc7ba5a8e27e35cb966ec1a1eda304d0316 (diff)
basic/macros: rename noreturn into _noreturn_ (#8456)
"noreturn" is reserved and can be used in other header files we include: [ 16s] In file included from /usr/include/gcrypt.h:30:0, [ 16s] from ../src/journal/journal-file.h:26, [ 16s] from ../src/journal/journal-vacuum.c:31: [ 16s] /usr/include/gpg-error.h:1544:46: error: expected ‘,’ or ‘;’ before ‘)’ token [ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2); Here we include grcrypt.h (which in turns include gpg-error.h) *after* we "noreturn" was defined in macro.h. (cherry picked from commit 848e863acc51ecfb0f3955c498874588201d9130)
Diffstat (limited to 'src/basic/macro.h')
-rw-r--r--src/basic/macro.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/basic/macro.h b/src/basic/macro.h
index 89bdd852a..1c64ea195 100644
--- a/src/basic/macro.h
+++ b/src/basic/macro.h
@@ -53,6 +53,15 @@
#else
#define _fallthrough_
#endif
+/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
+ * compiler versions */
+#ifndef _noreturn_
+#if __STDC_VERSION__ >= 201112L
+#define _noreturn_ _Noreturn
+#else
+#define _noreturn_ __attribute__((noreturn))
+#endif
+#endif
/* Temporarily disable some warnings */
#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
@@ -414,16 +423,7 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
#endif
#endif
-/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
- * compiler versions */
-#ifndef noreturn
-#if __STDC_VERSION__ >= 201112L
-#define noreturn _Noreturn
#else
-#define noreturn __attribute__((noreturn))
-#endif
-#endif
-
#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
static inline void func##p(type *p) { \
if (*p) \