#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
# define _RET_NONNULL , returns_nonnull
#endif
+#if __has_attribute(fallthrough)
+# define _FALLTHROUGH __attribute__((fallthrough));
+#endif
# define _CONSTRUCTOR(x) constructor(x)
#elif defined(__GNUC__)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
# define _DESTRUCTOR(x) destructor(x)
# define _ALLOC_SIZE(x) alloc_size(x)
#endif
+#if __GNUC__ >= 7
+# define _FALLTHROUGH __attribute__((fallthrough));
+#endif
#endif
#ifdef __sun
#ifndef _ALLOC_SIZE
# define _ALLOC_SIZE(x)
#endif
+#ifndef _FALLTHROUGH
+#define _FALLTHROUGH
+#endif
/*
* for warnings on macros, put in the macro content like this:
switch (type) {
case CAPABILITY:
len += 2; /* to cover the OPT-Param header */
- __attribute__ ((fallthrough));
+ _FALLTHROUGH
case OPT_PARAM:
printf("len: %u\n", len);
/* peek_for_as4 wants getp at capibility*/