summaryrefslogtreecommitdiffstats
path: root/lib/compiler.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:24:32 +0000
commit35cadacd2bb9383686753731e31bd7e145fb2506 (patch)
tree4489adbde75a837989533837185b2b8369a0bf68 /lib/compiler.h
parentAdding debian version 9.1-0.1. (diff)
downloadfrr-35cadacd2bb9383686753731e31bd7e145fb2506.tar.xz
frr-35cadacd2bb9383686753731e31bd7e145fb2506.zip
Merging upstream version 10.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/compiler.h')
-rw-r--r--lib/compiler.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/compiler.h b/lib/compiler.h
index ce67276..0326105 100644
--- a/lib/compiler.h
+++ b/lib/compiler.h
@@ -32,8 +32,8 @@ extern "C" {
#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
# define _RET_NONNULL , returns_nonnull
#endif
-#if __has_attribute(fallthrough)
-# define _FALLTHROUGH __attribute__((fallthrough));
+#if __has_attribute(fallthrough) && !defined(__cplusplus)
+# define fallthrough __attribute__((fallthrough));
#endif
# define _CONSTRUCTOR(x) constructor(x)
# define _DEPRECATED(x) deprecated(x)
@@ -56,8 +56,8 @@ extern "C" {
#if __GNUC__ < 5
# define __has_attribute(x) 0
#endif
-#if __GNUC__ >= 7
-# define _FALLTHROUGH __attribute__((fallthrough));
+#if __GNUC__ >= 7 && !defined(__cplusplus)
+# define fallthrough __attribute__((fallthrough));
#endif
#endif
@@ -112,8 +112,8 @@ extern "C" {
#ifndef _ALLOC_SIZE
# define _ALLOC_SIZE(x)
#endif
-#ifndef _FALLTHROUGH
-#define _FALLTHROUGH
+#if !defined(fallthrough) && !defined(__cplusplus)
+#define fallthrough
#endif
#ifndef _DEPRECATED
#define _DEPRECATED(x) deprecated
@@ -424,10 +424,10 @@ _Static_assert(sizeof(_uint64_t) == 8 && sizeof(_int64_t) == 8,
* type.)
*/
#ifndef __cplusplus
-#define prefixtype(uname, typename, fieldname) typename *fieldname;
+#define uniontype(uname, typename, fieldname) typename *fieldname;
#define TRANSPARENT_UNION __attribute__((transparent_union))
#else
-#define prefixtype(uname, typename, fieldname) \
+#define uniontype(uname, typename, fieldname) \
typename *fieldname; \
uname(typename *x) \
{ \