Check log_put() printf-like format

Thanks to Romain Tartière for the patch
http://groups.google.com/group/libnfc-devel/browse_thread/thread/da352d67e6965851
This commit is contained in:
Ludovic Rousseau 2012-05-16 13:15:34 +00:00
parent d28889c696
commit eb1e6d0cb4

View file

@ -23,11 +23,25 @@
#endif // HAVE_CONFIG_H
#if defined DEBUG
# ifndef __has_attribute
# define __has_attribute(x) 0
# endif
# if __has_attribute(format) || defined(__GNUC__)
# define __has_attribute_format 1
# endif
// User want debug features
#define LOGGING 1
int log_init (void);
int log_fini (void);
void log_put (const char *category, const char *priority, const char *format, ...);
void log_put (const char *category, const char *priority, const char *format, ...)
# if __has_attribute_format
__attribute__((format(printf, 3, 4)))
# endif
;
#define NFC_PRIORITY_FATAL "fatal"
#define NFC_PRIORITY_ALERT "alert"