summaryrefslogtreecommitdiffstats
path: root/include/libipset
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-01-18 17:48:22 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2011-01-18 17:48:22 +0100
commit712154704964906a59d481dc7edf43554f9eaf83 (patch)
tree0d757fa52642ff6cc4239f81a28bdc3d19146a7c /include/libipset
parent7ba43e68db3e61e0e8c13d5189f153a06954259d (diff)
Fix build with NDEBUG defined
The usage of the gcc option -Wunused-parameter interferes badly with the assert() macros. In case -DNDEBUG is specified build fails with: cc1: warnings being treated as errors print.c: In function 'ipset_print_family': print.c:92: error: unused parameter 'opt' print.c: In function 'ipset_print_port': print.c:413: error: unused parameter 'opt' print.c: In function 'ipset_print_proto': Fix it by taking into accout NDEBUG in the function arguments. Bug reported by Holger Eitzenberger.
Diffstat (limited to 'include/libipset')
-rw-r--r--include/libipset/utils.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/libipset/utils.h b/include/libipset/utils.h
index c22687f..2c88a83 100644
--- a/include/libipset/utils.h
+++ b/include/libipset/utils.h
@@ -25,6 +25,11 @@
#define MAX(a, b) (a > b ? a : b)
#define UNUSED __attribute__ ((unused))
+#ifdef NDEBUG
+#define ASSERT_UNUSED UNUSED
+#else
+#define ASSERT_UNUSED
+#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))