#define defineCallback2(x, arg1, arg2) \ void (WINAPI *callback_ ## x )( arg1, arg2 ); #define defineCallback3(x, arg1, arg2, arg3) \ void (WINAPI *callback_ ## x )( arg1, arg2, arg3 );Note: The pattern above is actually extended up to defineCallback8 for arg1..arg8.
defineCallback2(dragDrop, int foo, int noo) defineCallback3(dragStart, int foo, int noo, int koo)It works, but I'm thinking there's probably a way to make one function which tests for the presence of argN arguments, and uses only those which are present (like the variable parameters passed to printf). Perhaps something like #define defineCallback(x, y..), where I can use "y" in place of "arg1, arg2" and it conveys everything that's passed regardless of how many parameters there are ??