vulkan: make generated enum to strings helpers available from c++
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 22 Jan 2019 17:36:56 +0000 (17:36 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 22 Jan 2019 18:20:53 +0000 (18:20 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/vulkan/util/gen_enum_to_str.py

index fb9ecd6..06f74eb 100644 (file)
@@ -101,6 +101,10 @@ H_TEMPLATE = Template(textwrap.dedent(u"""\
     #include <vulkan/vulkan.h>
     #include <vulkan/vk_android_native_buffer.h>
 
+    #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')