summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Klausner <wiz@NetBSD.org>2015-08-06 13:40:54 +0200
committerThomas Klausner <wiz@NetBSD.org>2015-08-10 23:41:39 +0200
commitc1b89865b6ae797cb1391a9ac263bd20061611a7 (patch)
treea17b5ada89c362e842e4a9d60e7bf4c93beb14f0
parent5a3e0de677b7d68f7a7c7a212bfe55441c8e5ddb (diff)
Avoid redefinitions of u8, uint8_t, and GETBITS.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Connor Behan <connor.behan@gmail.com>
-rwxr-xr-xsrc/vb_i2c.h6
-rwxr-xr-xsrc/xgi.h2
2 files changed, 7 insertions, 1 deletions
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@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@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);