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).
This commit is contained in:
Romain Tartiere 2010-04-16 14:50:48 +00:00
parent 0b301d8ff6
commit 5302930b09

View file

@ -24,6 +24,8 @@
#ifndef _LIBNFC_MESSAGES_H_
#define _LIBNFC_MESSAGES_H_
#include <err.h>
// #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_