OSDN Git Service
(root)
/
android-x86
/
external-libpciaccess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
edf3908
)
Add endian macros for BSD.
author
Eric Anholt
<anholt@FreeBSD.org>
Sun, 30 Jul 2006 21:29:58 +0000
(14:29 -0700)
committer
Eric Anholt
<anholt@FreeBSD.org>
Sun, 30 Jul 2006 21:30:53 +0000
(14:30 -0700)
src/common_interface.c
patch
|
blob
|
history
diff --git
a/src/common_interface.c
b/src/common_interface.c
index
d2923dd
..
67e8e9a
100644
(file)
--- 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.
*