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:
parent
0b301d8ff6
commit
5302930b09
1 changed files with 5 additions and 3 deletions
|
@ -24,6 +24,8 @@
|
||||||
#ifndef _LIBNFC_MESSAGES_H_
|
#ifndef _LIBNFC_MESSAGES_H_
|
||||||
#define _LIBNFC_MESSAGES_H_
|
#define _LIBNFC_MESSAGES_H_
|
||||||
|
|
||||||
|
#include <err.h>
|
||||||
|
|
||||||
// #define DEBUG /* DEBUG flag can also be enabled using ./configure --enable-debug */
|
// #define DEBUG /* DEBUG flag can also be enabled using ./configure --enable-debug */
|
||||||
|
|
||||||
// Useful macros
|
// Useful macros
|
||||||
|
@ -34,8 +36,8 @@
|
||||||
#define DBG(...) {}
|
#define DBG(...) {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define INFO(x, ...) printf("INFO: " x "\n", ## __VA_ARGS__ )
|
#define INFO(...) warnx ("INFO: " __VA_ARGS__ )
|
||||||
#define WARN(x, ...) printf("WARNING: " x "\n", ## __VA_ARGS__ )
|
#define WARN(...) warnx ("WARNING: " __VA_ARGS__ )
|
||||||
#define ERR(x, ...) fprintf(stderr, "ERROR: " x "\n", ## __VA_ARGS__ )
|
#define ERR(...) warnx ("ERROR: " __VA_ARGS__ )
|
||||||
|
|
||||||
#endif // _LIBNFC_MESSAGES_H_
|
#endif // _LIBNFC_MESSAGES_H_
|
||||||
|
|
Loading…
Add table
Reference in a new issue