fix macro decl
authorMichael Wallner <mike@php.net>
Thu, 17 Dec 2015 10:07:54 +0000 (11:07 +0100)
committerMichael Wallner <mike@php.net>
Thu, 17 Dec 2015 10:07:54 +0000 (11:07 +0100)
m4/psi_macro.m4

index 0de4fdf..0ce6f84 100644 (file)
@@ -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;"
                ], [