--- xcb.h 2006-04-28 14:48:44.000000000 -0700 +++ xcb-new.h 2006-04-29 10:21:32.000000000 -0700 @@ -29,11 +29,12 @@ #define __XCB_H #include +#ifndef _X_PROTO_TYPES +#define _X_PROTO_TYPES + /* TODO: check for stdint in config? (HAVE_STDINT) fallback? */ #include -/* FIXME: these names conflict with those defined in Xmd.h. */ -#ifndef XMD_H typedef uint8_t BYTE; typedef uint8_t BOOL; typedef uint8_t CARD8; @@ -42,9 +43,9 @@ typedef int8_t INT8; typedef int16_t INT16; typedef int32_t INT32; -#endif /* XMD_H */ -#include +#endif + #include #include --- Xmd.h 2004-08-11 14:14:16.000000000 -0700 +++ Xmd-new.h 2006-04-29 10:20:15.000000000 -0700 @@ -100,6 +100,10 @@ #define SIZEOF(x) sz_/**/x #endif /* if ANSI C compiler else not */ +/* coexistance with xcb.h (which uses for protocol types) */ +#ifndef _X_PROTO_TYPES +#define _X_PROTO_TYPES + /* * Bitfield suffixes for the protocol structure elements, if you * need them. Note that bitfields are not guarranteed to be signed @@ -122,7 +126,7 @@ typedef int INT16; #endif #endif -#else +#else /* ! WORD64 */ #define B32 #define B16 #ifdef LONG64 @@ -149,9 +153,6 @@ typedef unsigned short CARD16; typedef unsigned char CARD8; -typedef CARD32 BITS32; -typedef CARD16 BITS16; - #ifndef I_NEED_OS2_H typedef CARD8 BYTE; typedef CARD8 BOOL; @@ -160,6 +161,39 @@ #define BOOL CARD8 #endif +#else /* _X_PROTO_TYPES */ + +/* Core protocol types are already defined in xcb.h: + * INT32, INT16, INT8, CARD32, CARD16, CARD8==BYTE==BOOL + */ + +#ifdef WORD64 +/* BUG: can't use C bitfields for protocol descriptions since a field's + * position within a word is not portable. + */ +#define B32 :32 +#define B16 :16 +#ifdef UNSIGNEDBITFIELDS +#pragma warning("XCB does not support using INT32 and INT16 for unsigned bit fields!") +#else +#pragma warning("XCB does not support defining INT32 and INT16 as the same size!") +#endif + +#else +#define B32 +#define B16 +#endif + +#if defined(WORD64) || defined(LONG64) +typedef long INT64; +typedef unsigned long CARD64; +#endif + +#endif /* _X_PROTO_TYPES */ + +typedef CARD32 BITS32; +typedef CARD16 BITS16; + /* * definitions for sign-extending bitfields on 64-bit architectures */