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
(parent:
7aca946
)
Fill in byte swapping routines for big-endian Solaris machines
author
Alan Coopersmith
<alan.coopersmith@sun.com>
Wed, 19 Nov 2008 03:54:42 +0000
(19:54 -0800)
committer
Alan Coopersmith
<alan.coopersmith@sun.com>
Wed, 19 Nov 2008 04:11:59 +0000
(20:11 -0800)
src/common_interface.c
patch
|
blob
|
history
diff --git
a/src/common_interface.c
b/src/common_interface.c
index
0cdf25d
..
8808fdf
100644
(file)
--- a/
src/common_interface.c
+++ b/
src/common_interface.c
@@
-52,10
+52,20
@@
#endif /* linux */
#elif defined(__sun)
-#define LETOH_16(x) (x)
-#define HTOLE_16(x) (x)
-#define LETOH_32(x) (x)
-#define HTOLE_32(x) (x)
+
+#include <sys/byteorder.h>
+
+#ifdef _BIG_ENDIAN
+# define LETOH_16(x) BSWAP_16(x)
+# define HTOLE_16(x) BSWAP_16(x)
+# define LETOH_32(x) BSWAP_32(x)
+# define HTOLE_32(x) BSWAP_32(x)
+#else
+# define LETOH_16(x) (x)
+# define HTOLE_16(x) (x)
+# define LETOH_32(x) (x)
+# define HTOLE_32(x) (x)
+#endif /* Solaris */
#else