Bug 22252

Summary: Xlib-xcb.h: _XFUNCPROTOBEGIN/END (extern "C") missing, breaks C++ linking
Product: xorg Reporter: Riku Salminen <rsalmin2>
Component: Lib/XlibAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: xcb
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Fixed version of Xlib-xcb.h, added _XFUNCPROTOBEGIN/END to solve C++ linking problems none

Description Riku Salminen 2009-06-12 03:53:45 UTC
Created attachment 26712 [details]
Fixed version of Xlib-xcb.h, added _XFUNCPROTOBEGIN/END to solve C++ linking problems

xorg/lib/libX11/include/X11/Xlib-xcb.h is missing extern "C" specifier. This breaks linking X11-xcb with C++ applications, resulting in undefined reference errors to Xlib-xcb.h functions (XGetXCBConnection, XSetEventQueueOwner) due to C++ name mangling.

Can be easily solved by adding _XFUNCPROTOBEGIN and _XFUNCPROTO end around the function prototypes in the file (seems to be the libX11 convention) or just extern "C".

Attached fixed version of the Xlib-xcb.h file.
Comment 1 Julien Cristau 2009-08-02 08:25:27 UTC
commit 640fec5f4feacd01a00eea3dcd4edb220907d3dc
Author: Julien Cristau <jcristau@debian.org>
Date:   Sun Aug 2 17:18:31 2009 +0200

    Add _XFUNCPROTOBEGIN/END to Xlib-xcb.h
    
    X.Org bug#22252 <https://bugs.freedesktop.org/show_bug.cgi?id=22252>
    
    Reported-by: Riku Salminen <rsalmin2@cc.hut.fi>
    Signed-off-by: Julien Cristau <jcristau@debian.org>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.