From: Timo Sirainen Date: Sun, 31 Jan 2010 17:09:44 +0000 (+0200) Subject: Added CONTEXT_CALLBACK2() helper macro. X-Git-Tag: 2.0.beta2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cee00f173e09468dad533a9c317244d43b794603;p=thirdparty%2Fdovecot%2Fcore.git Added CONTEXT_CALLBACK2() helper macro. --HG-- branch : HEAD --- diff --git a/src/lib/macros.h b/src/lib/macros.h index 4ddb0b908d..1b90ee7446 100644 --- a/src/lib/macros.h +++ b/src/lib/macros.h @@ -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)