Bug 22252 - Xlib-xcb.h: _XFUNCPROTOBEGIN/END (extern "C") missing, breaks C++ linking
Summary: Xlib-xcb.h: _XFUNCPROTOBEGIN/END (extern "C") missing, breaks C++ linking
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xlib (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-12 03:53 UTC by Riku Salminen
Modified: 2009-08-02 08:25 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Fixed version of Xlib-xcb.h, added _XFUNCPROTOBEGIN/END to solve C++ linking problems (426 bytes, text/x-chdr)
2009-06-12 03:53 UTC, Riku Salminen
no flags Details

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.