blob: 265de8b14ee5a75761b4e6922aa7d30b04145f44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <ccan/typesafe_cb/typesafe_cb.h>
#include <stdlib.h>
/* NULL args for callback function should be OK for normal and _def. */
static void _register_callback(void (*cb)(const void *arg), const void *arg)
{
}
#define register_callback(cb, arg) \
_register_callback(typesafe_cb(void, const void *, (cb), (arg)), (arg))
int main(int argc, char *argv[])
{
register_callback(NULL, "hello world");
return 0;
}
|