summaryrefslogtreecommitdiff
path: root/src/common_interface.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2006-07-30 14:29:58 -0700
committerEric Anholt <anholt@FreeBSD.org>2006-07-30 14:30:53 -0700
commitcf1b4d3ddfcdbaeddefc42b6eb19eb85a0a1e454 (patch)
treed7334081c0496be783b9625728cf78db1db413bb /src/common_interface.c
parentedf3908958eacc20162563b68aa45964f0e38b2c (diff)
Add endian macros for BSD.
Diffstat (limited to 'src/common_interface.c')
-rw-r--r--src/common_interface.c12
1 files changed, 12 insertions, 0 deletions
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 <byteswap.h>
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -49,6 +50,17 @@
# define HTOLE_32(x) (x)
#endif
+#else
+
+#include <sys/endian.h>
+
+#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.
*