X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fopt%2Fopt.h;h=e06cd4424c746e215185481ce08375b6024e49d0;hp=9075ceed37e8c0e61e0dedb1a94df6ba4efede3f;hb=156e5eb92f1d986957cb081b58320579c6e366dd;hpb=e610c8c6380caa05094294e2fa6392ba5c3f4024 diff --git a/ccan/opt/opt.h b/ccan/opt/opt.h index 9075ceed..e06cd442 100644 --- a/ccan/opt/opt.h +++ b/ccan/opt/opt.h @@ -315,22 +315,22 @@ struct opt_table { /* Resolves to the four parameters for non-arg callbacks. */ #define OPT_CB_NOARG(cb, arg) \ OPT_NOARG, \ - cast_if_any(char *(*)(void *), (cb), 0?(cb):(cb),\ - char *(*)(typeof(*(arg))*), \ - char *(*)(const typeof(*(arg))*), \ - char *(*)(const void *)), \ + typesafe_cb_cast3(char *(*)(void *), \ + char *(*)(typeof(*(arg))*), \ + char *(*)(const typeof(*(arg))*), \ + char *(*)(const void *), (cb)), \ NULL, NULL /* Resolves to the four parameters for arg callbacks. */ #define OPT_CB_ARG(cb, show, arg) \ OPT_HASARG, NULL, \ - cast_if_any(char *(*)(const char *,void *), (cb), 0?(cb):(cb), \ - char *(*)(const char *, typeof(*(arg))*), \ - char *(*)(const char *, const typeof(*(arg))*), \ - char *(*)(const char *, const void *)), \ - cast_if_type(void (*)(char buf[], const void *), (show), \ - 0?(show):(show), \ - void (*)(char buf[], const typeof(*(arg))*)) + typesafe_cb_cast3(char *(*)(const char *,void *), \ + char *(*)(const char *, typeof(*(arg))*), \ + char *(*)(const char *, const typeof(*(arg))*), \ + char *(*)(const char *, const void *), \ + (cb)), \ + typesafe_cb_cast(void (*)(char buf[], const void *), \ + void (*)(char buf[], const typeof(*(arg))*), (show)) /* Non-typesafe register function. */ void _opt_register(const char *names, enum opt_type type,