summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>2014-08-19 13:36:36 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2014-09-08 00:38:53 +0200
commit36725df7b4edbe49846792c67e1bede49596f76c (patch)
tree5bb59cb19532f88bb7f428c9e72e2f8cffa25670 /lib
parent9e03b48fee49964481e8febacfa549705eaa134a (diff)
downloadneardal-36725df7b4edbe49846792c67e1bede49596f76c.tar.gz
neardal-36725df7b4edbe49846792c67e1bede49596f76c.tar.bz2
neardal-36725df7b4edbe49846792c67e1bede49596f76c.zip
Add BUG() macro.
Diffstat (limited to 'lib')
-rw-r--r--lib/neardal_tools.h8
1 files changed, 7 insertions, 1 deletions
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 { \