# HG changeset patch # User Timo Sirainen # Date 1264957784 -7200 # Node ID 45709a87e4b3b5820decd53603f9b8d7f3b57771 # Parent 89928f6713507cb5825d891783cd46599443442d Added CONTEXT_CALLBACK2() helper macro. diff -r 89928f671350 -r 45709a87e4b3 src/lib/macros.h --- 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)