From 966a8e3acc6244025d265db0af5e20365566f2a4 Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 14 Oct 2006 21:51:24 +0000 Subject: redirect DEBUGP to 'debugp' function inside openpcd firmware git-svn-id: https://svn.gnumonks.org/trunk/librfid@1909 e0336214-984f-0b4b-a45f-81c69e1f0ede --- include/librfid/rfid.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/librfid/rfid.h b/include/librfid/rfid.h index f0ecc16..0b98be6 100644 --- a/include/librfid/rfid.h +++ b/include/librfid/rfid.h @@ -13,17 +13,30 @@ enum rfid_frametype { RFID_MIFARE_FRAME, }; -//#define DEBUG +#define DEBUG_LIBRFID -#ifdef DEBUG +#ifdef DEBUG_LIBRFID + +#ifdef LIBRFID_FIRMWARE +extern void debugp(const char *format, ...); +extern const char *hexdump(const void *data, unsigned int len); +#define rfid_hexdump(x, y) hexdump(x, y) +#define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args) +#define DEBUGPC(x, args ...) debugp(x, ## args) +#else /* LIBRFID_FIRMWARE */ +extern const char *rfid_hexdump(const void *data, unsigned int len); #define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args) #define DEBUGPC(x, args ...) fprintf(stderr, x, ## args) -#else +#endif /* LIBRFID_FIRMWARE */ + +#else /* DEBUG */ +extern const char *rfid_hexdump(const void *data, unsigned int len); + #define DEBUGP(x, args ...) #define DEBUGPC(x, args ...) -#endif -extern const char *rfid_hexdump(const void *data, unsigned int len); +#endif /* DEBUG */ + #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -- cgit v1.2.3