From d450c6edc92b3ba88a21f62330f6abd313e6cb0f Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Wed, 16 Mar 2022 18:35:36 +0000 Subject: [PATCH] Fix -Wstrict-prototypes in webgpu.h Bug: https://github.com/webgpu-native/webgpu-headers/issues/151 Change-Id: Ifb884478b45b9c069696b61ce95e56dbe53a96e1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83820 Auto-Submit: Corentin Wallez Reviewed-by: Austin Eng Reviewed-by: Loko Kung Commit-Queue: Loko Kung --- generator/templates/api.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/generator/templates/api.h b/generator/templates/api.h index 36488a0a4b..db9d94a81b 100644 --- a/generator/templates/api.h +++ b/generator/templates/api.h @@ -116,9 +116,13 @@ extern "C" { {% for type in by_category["function pointer"] %} typedef {{as_cType(type.return_type.name)}} (*{{as_cType(type.name)}})( - {%- for arg in type.arguments -%} - {% if not loop.first %}, {% endif %}{{as_annotated_cType(arg)}} - {%- endfor -%} + {%- if type.arguments == [] -%} + void + {%- else -%} + {%- for arg in type.arguments -%} + {% if not loop.first %}, {% endif %}{{as_annotated_cType(arg)}} + {%- endfor -%} + {%- endif -%} ); {% endfor %}