summary refs log tree commit diff
path: root/string/endian.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-21 23:39:35 +0000
committerUlrich Drepper <drepper@redhat.com>2008-05-21 23:39:35 +0000
commite92799fc450f529c860fefe3068df782b7041b9b (patch)
tree196a90579ba82e2e45a497db41bc08b45b5fc406 /string/endian.h
parentd8e763c60eba701cee64c03b767a8159823c6ea2 (diff)
downloadglibc-e92799fc450f529c860fefe3068df782b7041b9b.tar.gz
glibc-e92799fc450f529c860fefe3068df782b7041b9b.tar.xz
glibc-e92799fc450f529c860fefe3068df782b7041b9b.zip
* string/endian.h: Define new fixed-size hto* and *toh macros only
	is __USE_BSD.
Diffstat (limited to 'string/endian.h')
-rw-r--r--string/endian.h66
1 files changed, 34 insertions, 32 deletions
diff --git a/string/endian.h b/string/endian.h
index 430fb3a5c4..37d030a252 100644
--- a/string/endian.h
+++ b/string/endian.h
@@ -56,39 +56,41 @@
 #endif
 
 
+#ifdef __USE_BSD
 /* Conversion interfaces.  */
-#include <bits/byteswap.h>
-
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-# define htobe16(x) __bswap_16 (x)
-# define htole16(x) (x)
-# define be16toh(x) __bswap_16 (x)
-# define le16toh(x) (x)
-
-# define htobe32(x) __bswap_32 (x)
-# define htole32(x) (x)
-# define be32toh(x) __bswap_32 (x)
-# define le32toh(x) (x)
-
-# define htobe64(x) __bswap_64 (x)
-# define htole64(x) (x)
-# define be64toh(x) __bswap_64 (x)
-# define le64toh(x) (x)
-#else
-# define htobe16(x) (x)
-# define htole16(x) __bswap_16 (x)
-# define be16toh(x) (x)
-# define le16toh(x) __bswap_16 (x)
-
-# define htobe32(x) (x)
-# define htole32(x) __bswap_32 (x)
-# define be32toh(x) (x)
-# define le32toh(x) __bswap_32 (x)
-
-# define htobe64(x) (x)
-# define htole64(x) __bswap_64 (x)
-# define be64toh(x) (x)
-# define le64toh(x) __bswap_64 (x)
+# include <bits/byteswap.h>
+
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+#  define htobe16(x) __bswap_16 (x)
+#  define htole16(x) (x)
+#  define be16toh(x) __bswap_16 (x)
+#  define le16toh(x) (x)
+
+#  define htobe32(x) __bswap_32 (x)
+#  define htole32(x) (x)
+#  define be32toh(x) __bswap_32 (x)
+#  define le32toh(x) (x)
+
+#  define htobe64(x) __bswap_64 (x)
+#  define htole64(x) (x)
+#  define be64toh(x) __bswap_64 (x)
+#  define le64toh(x) (x)
+# else
+#  define htobe16(x) (x)
+#  define htole16(x) __bswap_16 (x)
+#  define be16toh(x) (x)
+#  define le16toh(x) __bswap_16 (x)
+
+#  define htobe32(x) (x)
+#  define htole32(x) __bswap_32 (x)
+#  define be32toh(x) (x)
+#  define le32toh(x) __bswap_32 (x)
+
+#  define htobe64(x) (x)
+#  define htole64(x) __bswap_64 (x)
+#  define be64toh(x) (x)
+#  define le64toh(x) __bswap_64 (x)
+# endif
 #endif
 
 #endif	/* endian.h */