From 36725df7b4edbe49846792c67e1bede49596f76c Mon Sep 17 00:00:00 2001 From: Oleg Zhurakivskyy Date: Tue, 19 Aug 2014 13:36:36 +0300 Subject: Add BUG() macro. --- lib/neardal_tools.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/neardal_tools.h b/lib/neardal_tools.h index dc41686..2807be7 100644 --- a/lib/neardal_tools.h +++ b/lib/neardal_tools.h @@ -21,6 +21,12 @@ #ifndef NEARDAL_TOOLS_H #define NEARDAL_TOOLS_H +#define BUG(...) \ +do { \ + fprintf(stderr, "%s:%d BUG:", __FILE__, __LINE__); \ + fprintf(stderr, " " __VA_ARGS__); \ + abort(); \ +} while (0) /***************************************************************************** * Debugging macro to manage assertion. @@ -85,7 +91,7 @@ static inline gpointer neardal_g_callback(GCallback gc) return p.gp; } -#define NEARDAL_G_CALLBACK(cb) neardal_g_callback(G_CALLBACK(cb)) +#define NEARDAL_G_CALLBACK(_cb) neardal_g_callback(G_CALLBACK((_cb))) #define NEARDAL_G_VARIANT_IN(_builder, _format, _data) \ do { \ -- cgit v1.2.3