diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-11-18 19:54:42 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-11-18 20:11:59 -0800 |
commit | ccbfd4cf2a7d203344bd1ffcb9d0024536a0eefa (patch) | |
tree | 2ea0e70af40bc4e7bb4ff1da447088cae1c8e825 /src/common_interface.c | |
parent | 7aca9465a61934d57781352f4fcc42b779392cd0 (diff) | |
download | xorg-lib-libpciaccess-ccbfd4cf2a7d203344bd1ffcb9d0024536a0eefa.tar.gz |
Fill in byte swapping routines for big-endian Solaris machines
Diffstat (limited to 'src/common_interface.c')
-rw-r--r-- | src/common_interface.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/common_interface.c b/src/common_interface.c index 0cdf25d..8808fdf 100644 --- 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 |