summaryrefslogtreecommitdiff
blob: 98a9e976cca3aa1683568ba5ff8165ca10a45ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 7629def0733b82687f2879095451d72e42e13db7 Mon Sep 17 00:00:00 2001
From: James Cloos <cloos@jhcloos.com>
Date: Sat, 28 Mar 2009 18:20:38 +0000
Subject: C sucks: define XEventClass in terms of unsigned int, not CARD32.

Apparently pulling in Xmd.h here breaks qt, since they both define an
INT32 type (and incompatible ones even, since Xmd's is unsigned long on
ILP32 because whoever wrote Xmd.h is a C novice).

(Based on inputproto commit b5cbe2d93f6c0129b8f29da97778f6d1b15c38f9.
Patch submitted to xorg@ in <20090117121713.46bf3332@family.dyweni.com>.)
---
diff --git a/Xge.h b/Xge.h
index cc03ece..51382ff 100644
--- a/Xge.h
+++ b/Xge.h
@@ -30,7 +30,6 @@
 #ifndef _XGE_H_
 #define _XGE_H_
 
-#include <X11/Xmd.h>
 #include <X11/Xlib.h>
 #include <X11/Xfuncproto.h>
 
@@ -39,12 +38,15 @@ _XFUNCPROTOBEGIN
 /**
  * Generic Event mask. 
  * To be used whenever a list of masks per extension has to be provided.
+ *
+ * But, don't actually use the CARD{8,16,32} types.  We can't get them them
+ * defined here without polluting the namespace.
  */
 typedef struct {
-    CARD8       extension;
-    CARD8       pad0;
-    CARD16      pad1;
-    CARD32      evmask;
+    unsigned char       extension;
+    unsigned char       pad0;
+    unsigned short      pad1;
+    unsigned int      evmask;
 } XGenericEventMask;
 
 Bool XGEQueryExtension(Display* dpy, int *event_basep, int *err_basep);
--
cgit v0.8.2