gl_table.py: add extern C guard for the generated glapitable.h
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 23 Nov 2017 18:51:14 +0000 (18:51 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 27 Nov 2017 19:23:05 +0000 (19:23 +0000)
The header can be included from C++, hence contents should have
appropriate notation.

Cc: mesa-stable@lists.freedesktop.org
Cc: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/mapi/glapi/gen/gl_table.py

index 80a44f4848847adc1c01ed95f6a4264f9b475f9a..579efa80e17f12b190007346be543c82a2a8f08a 100644 (file)
@@ -58,12 +58,20 @@ class PrintGlTable(gl_XML.gl_print_base):
         print '#endif'
         print ''
         print ''
+        print '#ifdef __cplusplus'
+        print 'extern "C" {'
+        print '#endif'
+        print ''
         print 'struct _glapi_table'
         print '{'
         return
 
     def printRealFooter(self):
         print '};'
+        print ''
+        print '#ifdef __cplusplus'
+        print '}'
+        print '#endif'
         return