Bug 19075 - DevicePresence macro miscompiled in C++ mode
Summary: DevicePresence macro miscompiled in C++ mode
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xi (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-13 18:35 UTC by Andriy Rysin
Modified: 2008-12-21 23:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
0001-Protect-_XiDevicePresenceNotifyEvent-declaration-aga.patch (1.09 KB, patch)
2008-12-14 18:19 UTC, Peter Hutterer
no flags Details | Splinter Review

Description Andriy Rysin 2008-12-13 18:35:53 UTC
If XInput.h is included in C++ code DevicePresence macro defined as
#define DevicePresence(dpy, type, _class)                       \
    {                                                           \
        extern int _XiGetDevicePresenceNotifyEvent(Display *);  \
        type = _XiGetDevicePresenceNotifyEvent(dpy);            \
        _class =  (0x10000 | _devicePresence);                  \
    }
produces wrong extern definition for _XiGetDevicePresenceNotifyEvent

A predefine of
extern "C" {
    extern int _XiGetDevicePresenceNotifyEvent(Display *);
}
before macro call in source code works but is an ugly hack.
Comment 1 Peter Hutterer 2008-12-14 16:04:20 UTC
which version of libXi is that?
Comment 2 Peter Hutterer 2008-12-14 16:09:24 UTC
sorry for the summary change, firefox plugin gone nuts.
Comment 3 Andriy Rysin 2008-12-14 16:36:35 UTC
The top of the header is:
/* $XFree86: xc/include/extensions/XInput.h,v 1.3 2001/12/14 19:53:28 dawes Exp $ */

The package it comes from is:
$ rpm -qf /usr/include/X11/extensions/XInput.h 
x11-proto-devel-7.3-6mdv2009.0

The Xi package is:
$ rpm -qf /usr/lib64/libXi.so
lib64xi-devel-1.1.3-3mdv2009.0
Comment 4 Peter Hutterer 2008-12-14 18:19:12 UTC
Created attachment 21141 [details] [review]
0001-Protect-_XiDevicePresenceNotifyEvent-declaration-aga.patch

This is basically the patch we have in the git version of libXi, where XInput.h resides now.
Comment 5 Peter Hutterer 2008-12-21 23:28:22 UTC
Pushed as 60c449cbb1769569ed5e98c75f26bd15627bd146


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.