summaryrefslogtreecommitdiff
path: root/udev/lib
diff options
context:
space:
mode:
Diffstat (limited to 'udev/lib')
-rw-r--r--udev/lib/libudev-private.h13
1 files changed, 9 insertions, 4 deletions
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 <syslog.h>
#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 */