Bug 36869 - dix.h and XKBfile.h have different declarations for NameForAtom()
Summary: dix.h and XKBfile.h have different declarations for NameForAtom()
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-05 06:22 UTC by Andrey Ponomarenko
Modified: 2011-05-05 06:49 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Andrey Ponomarenko 2011-05-05 06:22:17 UTC
Header files dix.h and XKBfile.h have different declarations for NameForAtom function ( see http://cgit.freedesktop.org/xorg/lib/libxkbfile/tree/include/X11/extensions/XKBfile.h ). Also dix.h and /usr/include/string.h have different declarations for ffs() function.


These differences cause the following errors (GCC 4.5):

In file included from /usr/include/xorg/dixstruct.h:27,
                 from /usr/include/xorg/inputstr.h:54,
                 from /usr/include/X11/extensions/XKBsrv.h:74,
/usr/include/xorg/dix.h:515: error: declaration of 'int ffs(int)' throws different exceptions
/usr/include/string.h:312: error: from previous declaration 'int ffs(int) throw ()'
/usr/include/X11/extensions/XKBfile.h:249: error: new declaration 'char* NameForAtom(Atom)'
/usr/include/xorg/dix.h:291: error: ambiguates old declaration 'const char* NameForAtom(Atom)'
Comment 1 Andrey Ponomarenko 2011-05-05 06:30:26 UTC
Also if compiling with G++:

/usr/include/xorg/dix.h:291: error: previous declaration of 'char* NameForAtom(Atom)' with 'C++' linkage
/usr/include/X11/extensions/XKBfile.h:249: error: conflicts with new declaration with 'C' linkage
Comment 2 Daniel Stone 2011-05-05 06:49:59 UTC
XKBfile.h is a client-side, not server-side header, so you'll have many clashing definitions anyway.  You cannot include any client-side and server-side headers together at all.  Among other things, the definition of CARD32 differs between client and server code on 64-bit systems, and many other clashes.

I don't think we support C++ server modules anyway: I guess you just need more extern "C" { } wrapping.

What were you trying to do with XKBfile.h, out of interest?


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.