X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fopt%2Fopt.h;h=e06cd4424c746e215185481ce08375b6024e49d0;hb=d0842865ca94a1bf4f7cdad329a2a0fc5d01b53a;hp=539a0a664de155962f3d2efdf116eca52d25fcee;hpb=e34192d580958aaffff3754a4e2bf1eccbb489f8;p=ccan diff --git a/ccan/opt/opt.h b/ccan/opt/opt.h index 539a0a66..e06cd442 100644 --- a/ccan/opt/opt.h +++ b/ccan/opt/opt.h @@ -315,21 +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), (cb)+0, \ - 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), (cb)+0, \ - 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), (show)+0, \ - 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,