1 #include "typesafe_cb/typesafe_cb.h"
4 static void _register_callback(void (*cb)(void *arg), void *arg)
8 #define register_callback(cb, arg) \
9 _register_callback(typesafe_cb(void, (cb), (arg)), (arg))
11 static void my_callback(char *p)
15 int main(int argc, char *argv[])
19 #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P
20 #error "Unfortunately we don't fail if cast_if_type is a noop."
27 /* This should work always. */
28 register_callback(my_callback, "hello world");
30 /* This will fail with FAIL defined */
31 register_callback(my_callback, p);