diff options
Diffstat (limited to 'src/pies.h')
-rw-r--r-- | src/pies.h | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -416,26 +416,34 @@ int meta1parse (void); extern int diag_output; #define DIAG_OUTPUT(x) (diag_output & (x)) void diag_setup (int flags); -void logmsg (int prio, const char *fmt, ...); -void logmsg_printf (int prio, const char *fmt, ...); +#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __attribute__(x) +#endif + +#ifndef PIES_PRINTFLIKE +# define PIES_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg))) +#endif + +void logmsg (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); +void logmsg_printf (int prio, const char *fmt, ...) PIES_PRINTFLIKE(2,3); void logmsg_vprintf (int prio, const char *fmt, va_list ap); extern unsigned debug_level; extern int source_info_option; -void debug_msg (const char *fmt, ...); +void debug_msg (const char *fmt, ...) PIES_PRINTFLIKE(1,2); #define debug(lev, args) \ do \ if (debug_level >= lev) \ { \ if (source_info_option) \ - logmsg_printf (LOG_DEBUG, "%s:%lu:%s: ", \ + logmsg_printf (LOG_DEBUG, "%s:%d:%s: ", \ __FILE__, __LINE__, __FUNCTION__); \ debug_msg args; \ } \ while (0) |