summaryrefslogtreecommitdiffstats
path: root/iptables/xshared.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-08-02 17:05:15 +0200
committerFlorian Westphal <fw@strlen.de>2018-08-04 14:24:54 +0200
commit78b9d438037f2c83a7bbb73eb1b86cc295967905 (patch)
treeda1268751fdf521e545fefdbd126717c84f6ce52 /iptables/xshared.h
parent14ad525cf2ad35928c12e7ec6710fb556f6d1ef7 (diff)
Consolidate DEBUGP macros
This debug printing macro was defined in various places, always identical. Move it into xshared.h and drop it from sources including that header. There are a few exceptions: * iptables-xml.c did not include xshared.h, which this patch changes. * Sources in extensions and libiptc mostly left alone since they don't include xshared.h (and maybe shouldn't). Only libxt_set.h does, so it's converted, too. This also converts DEBUG define use in libip6t_hbh.c to avoid a compiler warning. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/xshared.h')
-rw-r--r--iptables/xshared.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/iptables/xshared.h b/iptables/xshared.h
index 533c5268..363549db 100644
--- a/iptables/xshared.h
+++ b/iptables/xshared.h
@@ -10,6 +10,12 @@
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
+#ifdef DEBUG
+#define DEBUGP(x, args...) fprintf(stdout, x, ## args)
+#else
+#define DEBUGP(x, args...)
+#endif
+
enum {
OPT_NONE = 0,
OPT_NUMERIC = 1 << 0,