From cf1b4d3ddfcdbaeddefc42b6eb19eb85a0a1e454 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 30 Jul 2006 14:29:58 -0700 Subject: Add endian macros for BSD. --- src/common_interface.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/common_interface.c') diff --git a/src/common_interface.c b/src/common_interface.c index d2923dd..67e8e9a 100644 --- a/src/common_interface.c +++ b/src/common_interface.c @@ -35,6 +35,7 @@ #include "pciaccess.h" #include "pciaccess_private.h" +#ifdef __linux__ #include #if __BYTE_ORDER == __BIG_ENDIAN @@ -49,6 +50,17 @@ # define HTOLE_32(x) (x) #endif +#else + +#include + +#define LETOH_16(x) le16toh(x) +#define HTOLE_16(x) htole16(x) +#define LETOH_32(x) le32toh(x) +#define HTOLE_32(x) htole32(x) + +#endif + /** * Read a device's expansion ROM. * -- cgit v1.2.3