]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/compiler.h
isisd: implemented the 'sequence-number-skipped' notification
[mirror_frr.git] / lib / compiler.h
index 49a2f2a422c81699bf9f8324e6e0d3e80c156715..24b8fafd108a29a40e96688fcf7198ecc865be33 100644 (file)
  *   void prototype(void) __attribute__((_CONSTRUCTOR(100)));
  */
 #if defined(__clang__)
-# if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
+#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
 #  define _RET_NONNULL    , returns_nonnull
-# endif
+#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)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
 #  define _RET_NONNULL    , returns_nonnull
-# endif
-# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#endif
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
 #  define _CONSTRUCTOR(x) constructor(x)
 #  define _DESTRUCTOR(x)  destructor(x)
 #  define _ALLOC_SIZE(x)  alloc_size(x)
-# endif
+#endif
+#if __GNUC__ >= 7
+#  define _FALLTHROUGH __attribute__((fallthrough));
+#endif
 #endif
 
 #ifdef __sun
 /* Solaris doesn't do constructor priorities due to linker restrictions */
-# undef _CONSTRUCTOR
-# undef _DESTRUCTOR
+#undef _CONSTRUCTOR
+#undef _DESTRUCTOR
 #endif
 
 /* fallback versions */
@@ -55,6 +61,9 @@
 #ifndef _ALLOC_SIZE
 # define _ALLOC_SIZE(x)
 #endif
+#ifndef _FALLTHROUGH
+#define _FALLTHROUGH
+#endif
 
 /*
  * for warnings on macros, put in the macro content like this:
@@ -76,6 +85,7 @@
 
 #else
 #define CPP_WARN(text)
+#define CPP_NOTICE(text)
 #endif
 
 #endif /* _FRR_COMPILER_H */