summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-06-15 07:30:36 +0000
committerChristian Grothoff <christian@grothoff.org>2011-06-15 07:30:36 +0000
commit9e8f0edea1b7251771365ec9ef6ebb45462be37c (patch)
tree4742307c7d976229cf2952322babc34a8da3a393
parentc33a1ca9a2de02bb43f601cd1b33a53c7f3309e9 (diff)
define htole16 if libc does not
-rw-r--r--src/transport/wlan/byteorder.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/transport/wlan/byteorder.h b/src/transport/wlan/byteorder.h
index 9e16fd70c..c982669bf 100644
--- a/src/transport/wlan/byteorder.h
+++ b/src/transport/wlan/byteorder.h
@@ -58,6 +58,42 @@
typedef uint8_t u_int8_t;
#endif
+#ifndef htole16
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+# define htobe16(x) ___my_swab16 (x)
+# define htole16(x) (x)
+# define be16toh(x) ___my_swab16 (x)
+# define le16toh(x) (x)
+
+# define htobe32(x) ___my_swab32 (x)
+# define htole32(x) (x)
+# define be32toh(x) ___my_swab32 (x)
+# define le32toh(x) (x)
+
+# define htobe64(x) ___my_swab64 (x)
+# define htole64(x) (x)
+# define be64toh(x) ___my_swab64 (x)
+# define le64toh(x) (x)
+# else
+# define htobe16(x) (x)
+# define htole16(x) ___my_swab16 (x)
+# define be16toh(x) (x)
+# define le16toh(x) ___my_swab16 (x)
+
+# define htobe32(x) (x)
+# define htole32(x) ___my_swab32 (x)
+# define be32toh(x) (x)
+# define le32toh(x) ___my_swab32 (x)
+
+# define htobe64(x) (x)
+# define htole64(x) ___my_swab64 (x)
+# define be64toh(x) (x)
+# define le64toh(x) ___my_swab64 (x)
+# endif
+#endif
+
+
+
#endif
/*