summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2015-01-08 13:07:35 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2015-01-08 13:56:41 +0100
commitc48a519da2a85d11d76217aed6e78395dd7f7f57 (patch)
treec6d93e09eb34e7f891f57049aea4a0ff7149a307 /include
parent04f86e159a0feddf0e0c4c27e70b5ae9a2176969 (diff)
src: modify pr_debug() to use printf and introduce to pr_gmp_debug()
Modify pr_debug() to use printf so we get debugging traces for proto-ctx when --with-mini-gmp is enabled. Add pr_gmp_debug(), this is disabled with --with-mini-gmp since it relies on the gmp_printf(), which is not available in the mini-gmp implementation. Suggested by Patrick. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/utils.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/utils.h b/include/utils.h
index dcefc6b6..397c1978 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -13,12 +13,18 @@
#define BITS_PER_BYTE 8
-#if defined(DEBUG) && defined(HAVE_LIBGMP)
-#define pr_debug(fmt, arg...) gmp_printf(fmt, ##arg)
+#if defined(DEBUG)
+#define pr_debug(fmt, arg...) printf(fmt, ##arg)
#else
#define pr_debug(fmt, arg...) ({ if (false) {}; 0; })
#endif
+#if defined(DEBUG) && defined(HAVE_LIBGMP)
+#define pr_gmp_debug(fmt, arg...) gmp_printf(fmt, ##arg)
+#else
+#define pr_gmp_debug(fmt, arg...) ({ if (false) {}; 0; })
+#endif
+
#define __fmtstring(x, y) __attribute__((format(printf, x, y)))
#if 0
#define __gmp_fmtstring(x, y) __fmtstring(x, y)