changeset 10614:45709a87e4b3 HEAD

Added CONTEXT_CALLBACK2() helper macro.
author Timo Sirainen <tss@iki.fi>
date Sun, 31 Jan 2010 19:09:44 +0200
parents 89928f671350
children 8f9fc7fa7c73
files src/lib/macros.h
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/macros.h	Sun Jan 31 17:57:13 2010 +0200
+++ b/src/lib/macros.h	Sun Jan 31 19:09:44 2010 +0200
@@ -146,9 +146,14 @@
 #  define CONTEXT_CALLBACK(name, callback_type, callback, context, ...) \
 	({(void)(1 ? 0 : callback(context)); \
 	name(__VA_ARGS__, (callback_type *)callback, context); })
+#  define CONTEXT_CALLBACK2(name, callback_type, callback, arg1_type, context, ...) \
+	({(void)(1 ? 0 : callback((arg1_type)0, context)); \
+	name(__VA_ARGS__, (callback_type *)callback, context); })
 #else
 #  define CONTEXT_CALLBACK(name, callback_type, callback, context, ...) \
 	name(__VA_ARGS__, (callback_type *)callback, context)
+#  define CONTEXT_CALLBACK2(name, callback_type, callback, arg1_type, context, ...) \
+	name(__VA_ARGS__, (callback_type *)callback, context)
 #endif
 
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)