From c48a519da2a85d11d76217aed6e78395dd7f7f57 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Thu, 8 Jan 2015 13:07:35 +0100 Subject: 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 --- include/utils.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include') 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) -- cgit v1.2.3