3 #undef CALLBACK_TYPENAME
4 #undef CALLBACK_SETTERNAME
6 #undef DECLARE_CALLBACK
8 #define xglue(x, y) x ## y
9 #define glue(x, y) xglue(x, y)
11 #ifdef CALLBACK_FAMILY
12 #define CALLBACK_TYPENAME(name) glue(glue(glue(glue(glue(CALLBACK_PREFIX, _cb_), CALLBACK_FAMILY), _), name), _t)
13 #define CALLBACK_SETTERNAME(name) glue(glue(glue(glue(CALLBACK_PREFIX, _setcb_), CALLBACK_FAMILY), _), name)
15 #define CALLBACK_TYPENAME(name) glue(glue(glue(CALLBACK_PREFIX, _cb_), name), _t)
16 #define CALLBACK_SETTERNAME(name) glue(glue(CALLBACK_PREFIX, _setcb_), name)
19 #define DECLARE_CALLBACK(ret_type, name, args) \
20 typedef ret_type(*CALLBACK_TYPENAME(name))args
22 #define DEFINE_DECL_CALLBACK(ret_type, name, args) \
23 DECLARE_CALLBACK(ret_type, name, args); \
24 void CALLBACK_SETTERNAME(name)(CALLBACK_TYPENAME(name) cb)
26 #define DEFINE_DECL_CALLBACK_CUSTOM(ret_type, name, args, setter_args) \
27 DECLARE_CALLBACK(ret_type, name, args); \
28 void CALLBACK_SETTERNAME(name)setter_args