X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fopt%2Fopt.h;h=9075ceed37e8c0e61e0dedb1a94df6ba4efede3f;hb=082d651ffd87f78f20d56aa477c3c75d7361c1e1;hp=539a0a664de155962f3d2efdf116eca52d25fcee;hpb=e34192d580958aaffff3754a4e2bf1eccbb489f8;p=ccan diff --git a/ccan/opt/opt.h b/ccan/opt/opt.h index 539a0a66..9075ceed 100644 --- a/ccan/opt/opt.h +++ b/ccan/opt/opt.h @@ -315,7 +315,7 @@ 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, \ + cast_if_any(char *(*)(void *), (cb), 0?(cb):(cb),\ char *(*)(typeof(*(arg))*), \ char *(*)(const typeof(*(arg))*), \ char *(*)(const void *)), \ @@ -324,11 +324,12 @@ struct opt_table { /* 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, \ + 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), (show)+0, \ + cast_if_type(void (*)(char buf[], const void *), (show), \ + 0?(show):(show), \ void (*)(char buf[], const typeof(*(arg))*)) /* Non-typesafe register function. */