From 9176ac1f4e42f71df692773651898100b253774c Mon Sep 17 00:00:00 2001 From: Alan Jenkins Date: Mon, 29 Sep 2008 17:50:21 +0100 Subject: allow compiler to check dbg() arguments on non-debug builds Signed-off-by: Alan Jenkins --- udev/lib/libudev-private.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'udev/lib') diff --git a/udev/lib/libudev-private.h b/udev/lib/libudev-private.h index 162b33aef6..8f847158b2 100644 --- a/udev/lib/libudev-private.h +++ b/udev/lib/libudev-private.h @@ -23,12 +23,17 @@ #include #include "libudev.h" +static inline void __attribute__ ((format(printf, 2, 3))) +log_null(struct udev *udev, const char *format, ...) +{ +} + #ifdef USE_LOG #ifdef USE_DEBUG #define dbg(udev, arg...) \ udev_log(udev, LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, ## arg) #else -#define dbg(format, arg...) do { } while (0) +#define dbg log_null #endif /* USE_DEBUG */ #define info(udev, arg...) \ @@ -37,9 +42,9 @@ #define err(udev, arg...) \ udev_log(udev, LOG_ERR, __FILE__, __LINE__, __FUNCTION__, ## arg) #else -#define dbg(format, arg...) do { } while (0) -#define info(format, arg...) do { } while (0) -#define err(format, arg...) do { } while (0) +#define dbg log_null +#define info log_null +#define err log_null #endif /* libudev */ -- cgit v1.2.3-54-g00ecf