mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-01 05:06:38 +00:00
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:
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user