From: Michael Wallner Date: Thu, 17 Dec 2015 10:07:54 +0000 (+0100) Subject: fix macro decl X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=bd7cdec42afa560883c47f3803a30cb580cf152f;p=m6w6%2Fext-psi fix macro decl --- diff --git a/m4/psi_macro.m4 b/m4/psi_macro.m4 index 0de4fdf..0ce6f84 100644 --- a/m4/psi_macro.m4 +++ b/m4/psi_macro.m4 @@ -4,13 +4,24 @@ AC_DEFUN(PSI_MACRO, [ $3 macro_type="PSI_VAR_TYPE($1)" macro_name="PSI_VAR_NAME($1)" - ifelse([$2], [], [ - macro_decl="()" - macro_call="" - ], [ - macro_decl="$2" - macro_call="(m4_map_args_sep([PSI_VAR_NAME(], [)], [, ], m4_bregexp($2, [(\(.*\))], [\1])))" - ]) + m4_case([$2], + [(void)], [ + macro_decl="(void)" + macro_call="()" + ], + [()], [ + macro_decl="()" + macro_call="()" + ], + [], [ + macro_decl="()" + macro_call="" + ], + [ + macro_decl="$2" + macro_call="(m4_map_args_sep([PSI_VAR_NAME(], [)], [, ], m4_bregexp($2, [(\(.*\))], [\1])))" + ] + ) ifelse(PSI_VAR_TYPE($1), [void], [ macro_body="$macro_name$macro_call;" ], [