[Mesa-dev] [PATCH] vulkan: make generated enum to strings helpers available from c++

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Jan 22 17:36:56 UTC 2019


Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/vulkan/util/gen_enum_to_str.py | 8 ++++++++
 1 file changed, 8 insertions(+)

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 <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')
 
-- 
2.20.1



More information about the mesa-dev mailing list