comparison bswap.h @ 20:fce16251755c src

Remove all trailing whitespace, patch by Erik Hovland *erik$hovland dot org%
author rathann
date Sat, 06 Sep 2008 21:55:51 +0000
parents fdbae45c30fc
children 4aa618ae094f
comparison
equal deleted inserted replaced
19:7f7e87bd7536 20:fce16251755c
21 */ 21 */
22 22
23 #include <config.h> 23 #include <config.h>
24 24
25 #if defined(WORDS_BIGENDIAN) 25 #if defined(WORDS_BIGENDIAN)
26 /* All bigendian systems are fine, just ignore the swaps. */ 26 /* All bigendian systems are fine, just ignore the swaps. */
27 #define B2N_16(x) (void)(x) 27 #define B2N_16(x) (void)(x)
28 #define B2N_32(x) (void)(x) 28 #define B2N_32(x) (void)(x)
29 #define B2N_64(x) (void)(x) 29 #define B2N_64(x) (void)(x)
30 30
31 #else 31 #else
32 32
33 /* For __FreeBSD_version */ 33 /* For __FreeBSD_version */
34 #if defined(HAVE_SYS_PARAM_H) 34 #if defined(HAVE_SYS_PARAM_H)
35 #include <sys/param.h> 35 #include <sys/param.h>
36 #endif 36 #endif
63 #include <sys/endian.h> 63 #include <sys/endian.h>
64 #define B2N_16(x) x = be16toh(x) 64 #define B2N_16(x) x = be16toh(x)
65 #define B2N_32(x) x = be32toh(x) 65 #define B2N_32(x) x = be32toh(x)
66 #define B2N_64(x) x = be64toh(x) 66 #define B2N_64(x) x = be64toh(x)
67 67
68 /* This is a slow but portable implementation, it has multiple evaluation 68 /* This is a slow but portable implementation, it has multiple evaluation
69 * problems so beware. 69 * problems so beware.
70 * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such 70 * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such
71 * functionality! 71 * functionality!
72 */ 72 */
73 73
74 #elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__) || defined(__BEOS__) 74 #elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__) || defined(__BEOS__)
75 #define B2N_16(x) \ 75 #define B2N_16(x) \
76 x = ((((x) & 0xff00) >> 8) | \ 76 x = ((((x) & 0xff00) >> 8) | \