From 5302930b09a59c70fec6880833b4b8b9c5c8c162 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Fri, 16 Apr 2010 14:50:48 +0000 Subject: [PATCH] Avoid using a 'comma pasting' GNU extension (non-portable, reported my clang). This is not a 'complete' fix since the DBG macro is still using it; but more globally, this file should not be part of the libnfc installed files. We should rely on error codes and maybe some logging mechanism (e.g. syslog() on POSIX compliant systems and RegisterEventSource() / ReportEvent() on Windows). --- include/nfc/nfc-messages.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/nfc/nfc-messages.h b/include/nfc/nfc-messages.h index bd952c7..e1b856a 100644 --- a/include/nfc/nfc-messages.h +++ b/include/nfc/nfc-messages.h @@ -24,6 +24,8 @@ #ifndef _LIBNFC_MESSAGES_H_ #define _LIBNFC_MESSAGES_H_ +#include + // #define DEBUG /* DEBUG flag can also be enabled using ./configure --enable-debug */ // Useful macros @@ -34,8 +36,8 @@ #define DBG(...) {} #endif -#define INFO(x, ...) printf("INFO: " x "\n", ## __VA_ARGS__ ) -#define WARN(x, ...) printf("WARNING: " x "\n", ## __VA_ARGS__ ) -#define ERR(x, ...) fprintf(stderr, "ERROR: " x "\n", ## __VA_ARGS__ ) +#define INFO(...) warnx ("INFO: " __VA_ARGS__ ) +#define WARN(...) warnx ("WARNING: " __VA_ARGS__ ) +#define ERR(...) warnx ("ERROR: " __VA_ARGS__ ) #endif // _LIBNFC_MESSAGES_H_