mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb.git
synced 2026-05-06 13:48:00 +02:00
Added generation of extern "C" for compatibility with C++
The auto-generated header files now include an extern "C" declaration for compatibility with C++. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
25e59ccc0d
commit
9afadd2aef
1 changed files with 12 additions and 0 deletions
|
|
@ -176,6 +176,12 @@ def c_open(self):
|
|||
for (n, h) in self.imports:
|
||||
_hc('#include "%s.h"', h)
|
||||
|
||||
_h('')
|
||||
_h('#ifdef __cplusplus')
|
||||
_h('extern "C" {')
|
||||
_h('#endif')
|
||||
|
||||
if _ns.is_ext:
|
||||
_h('')
|
||||
_h('#define XCB_%s_MAJOR_VERSION %s', _ns.ext_name.upper(), _ns.major_version)
|
||||
_h('#define XCB_%s_MINOR_VERSION %s', _ns.ext_name.upper(), _ns.minor_version)
|
||||
|
|
@ -193,6 +199,12 @@ def c_close(self):
|
|||
_h_setlevel(2)
|
||||
_c_setlevel(2)
|
||||
_hc('')
|
||||
|
||||
_h('')
|
||||
_h('#ifdef __cplusplus')
|
||||
_h('}')
|
||||
_h('#endif')
|
||||
|
||||
_h('')
|
||||
_h('#endif')
|
||||
_h('')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue