From 38d59cefff831bc1a80f145159f17783402a95b0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 24 Jun 2015 15:30:59 +1000 Subject: Add a debug_trace() macro for easier debugging Disabled by default, define DEBUG_TRACE when needed Signed-off-by: Peter Hutterer --- src/libinput-util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/libinput-util.h') diff --git a/src/libinput-util.h b/src/libinput-util.h index 4f73ad41..0c56b765 100644 --- a/src/libinput-util.h +++ b/src/libinput-util.h @@ -93,6 +93,15 @@ int list_empty(const struct list *list); #define streq(s1, s2) (strcmp((s1), (s2)) == 0) #define strneq(s1, s2, n) (strncmp((s1), (s2), (n)) == 0) +#ifdef DEBUG_TRACE +#define debug_trace(...) \ + do { \ + printf("%s:%d %s() - ", __FILE__, __LINE__, __func__); \ + printf(__VA_ARGS__); \ + } while (0) +#else +#define debug_trace(...) { } +#endif #define LIBINPUT_EXPORT __attribute__ ((visibility("default"))) static inline void * -- cgit v1.2.3