From: Lionel Landwerlin Date: Tue, 22 Jan 2019 17:36:56 +0000 (+0000) Subject: vulkan: make generated enum to strings helpers available from c++ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a75b12ce66f0dcaa747b07410d344467e26242d8;p=mesa.git vulkan: make generated enum to strings helpers available from c++ Signed-off-by: Lionel Landwerlin Reviewed-by: Caio Marcelo de Oliveira Filho --- diff --git a/src/vulkan/util/gen_enum_to_str.py b/src/vulkan/util/gen_enum_to_str.py index fb9ecd65c6d..06f74eb487c 100644 --- a/src/vulkan/util/gen_enum_to_str.py +++ b/src/vulkan/util/gen_enum_to_str.py @@ -101,6 +101,10 @@ H_TEMPLATE = Template(textwrap.dedent(u"""\ #include #include + #ifdef __cplusplus + extern "C" { + #endif + % for ext in extensions: #define _${ext.name}_number (${ext.number}) % endfor @@ -109,6 +113,10 @@ H_TEMPLATE = Template(textwrap.dedent(u"""\ const char * vk_${enum.name[2:]}_to_str(${enum.name} input); % endfor + #ifdef __cplusplus + } /* extern "C" */ + #endif + #endif"""), output_encoding='utf-8')