getting XI error codes - implicit declaration issue

Peter Hutterer peter.hutterer at who-t.net
Sun Sep 13 23:35:42 PDT 2009


On Fri, Sep 11, 2009 at 04:19:46PM +0200, Christian Beier wrote:
> 
> Hi there,
> there seems to be a little issue with the way one registers for XInput
> error codes: if i'm not totally wrong, these are defined nowhere, but
> dynamically generated and one has to get the actual values via macros
> like BadDevice(). But: (at least with git master xorg) this one
> evaluates to _xibaddevice(), defined in libXi/src/XExtInt.c, which in
> turn seems to be a private symbol in libxi, as i get 'implicit
> declaration of function _xibaddevice' warnings while compiling my app.
> while it seems to work okay, shouldn the _xibaddevice declaration made
> public or the macro be turned into a function?

something like this should do?

>From 570af989a542621e94ca756a9bee09f4f04586cc Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at who-t.net>
Date: Mon, 14 Sep 2009 16:34:18 +1000
Subject: [PATCH] Declare _xibad* functions before the Bad* macros.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 include/X11/extensions/XInput.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/X11/extensions/XInput.h b/include/X11/extensions/XInput.h
index 561465c..b17f388 100644
--- a/include/X11/extensions/XInput.h
+++ b/include/X11/extensions/XInput.h
@@ -159,6 +159,11 @@ SOFTWARE.
 extern "C" {
 #endif
     extern int _XiGetDevicePresenceNotifyEvent(Display *);
+    extern void _xibaddevice( Display *dpy, int *error);
+    extern void _xibadclass( Display *dpy, int *error);
+    extern void _xibadevent( Display *dpy, int *error);
+    extern void _xibadmode( Display *dpy, int *error);
+    extern void _xidevicebusy( Display *dpy, int *error);
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif
-- 
1.6.3.rc1.2.g0164.dirty

Cheers,
  Peter



More information about the xorg mailing list