[PATCH:xf86-video-xgi 01/19] Avoid redefinitions of u8, uint8_t, and GETBITS.
Thomas Klausner
wiz at NetBSD.org
Thu Aug 6 05:56:59 PDT 2015
Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
---
src/vb_i2c.h | 6 +++++-
src/xgi.h | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/vb_i2c.h b/src/vb_i2c.h
index 1e9de25..69f02cd 100755
--- a/src/vb_i2c.h
+++ b/src/vb_i2c.h
@@ -7,7 +7,9 @@
#endif
#ifndef u32
#define u32 unsigned long
-#define u8 unsigned long
+#endif
+#ifndef u8
+#define u8 uint8_t
#endif
/* Jong at 08052009 */
@@ -82,7 +84,9 @@
// set bits as 1 between bit(a) and bit(b)
#define MASK(n) ( BITS(LARGE(n)-SMALL(n)+1) << SMALL(n) )
// get bits [a:b]'s binary value
+#ifndef GETBITS
#define GETBITS(b,n) ( ((b) & MASK(n)) >> SMALL(n) ) /* Jong at 08032009 */
+#endif
// set binary value from [a:0] to [c:d]
#define SETBITS(b, n) ( ( (b) << ((1?n) > (0?n) ? (0?n) : (1?n)) ) & MASK(n) )
// move bits value from [a:b] to [c:d]
diff --git a/src/xgi.h b/src/xgi.h
index 0bc8d30..a5702c4 100755
--- a/src/xgi.h
+++ b/src/xgi.h
@@ -1022,7 +1022,9 @@ extern void XGI_SetRegANDOR(XGIIOADDRESS Port, USHORT Index, USHORT DataAND,
extern void XGI_SetRegAND(XGIIOADDRESS Port, USHORT Index, USHORT DataAND);
extern void XGI_SetRegOR(XGIIOADDRESS Port, USHORT Index, USHORT DataOR);
+#ifndef uint8_t
#define uint8_t CARD8
+#endif
extern void XGI_WriteDAC(XGIIOADDRESS dac_data, unsigned shift,
unsigned ordering, uint8_t red, uint8_t green, uint8_t blue);
--
2.5.0
More information about the xorg-devel
mailing list