summaryrefslogtreecommitdiffstats
path: root/include/libipset/ip_set_compiler.h
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@netfilter.org>2021-02-09 19:41:23 +0100
committerJozsef Kadlecsik <kadlec@netfilter.org>2021-02-09 19:41:23 +0100
commitb031a4db2237503d370624cfc9573ead7438fddf (patch)
tree80dff38a9024c8c0b511fab39883591e0700b858 /include/libipset/ip_set_compiler.h
parent423a309ca8df5747e41a28ddce33d61fe64a2844 (diff)
Handle -Werror=implicit-fallthrough= in debug mode compiling
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Diffstat (limited to 'include/libipset/ip_set_compiler.h')
-rw-r--r--include/libipset/ip_set_compiler.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/libipset/ip_set_compiler.h b/include/libipset/ip_set_compiler.h
new file mode 100644
index 0000000..1b392f8
--- /dev/null
+++ b/include/libipset/ip_set_compiler.h
@@ -0,0 +1,15 @@
+#ifndef __IP_SET_COMPILER_H
+#define __IP_SET_COMPILER_H
+
+/* Compiler attributes */
+#ifndef __has_attribute
+# define __has_attribute(x) __GCC4_has_attribute_##x
+# define __GCC4_has_attribute___fallthrough__ 0
+#endif
+
+#if __has_attribute(__fallthrough__)
+# define fallthrough __attribute__((__fallthrough__))
+#else
+# define fallthrough do {} while (0) /* fallthrough */
+#endif
+#endif /* __IP_SET_COMPILER_H */