*
*/
+/*
+ * This compat header provides the following defines:
+ *
+ * LITTLE_ENDIAN
+ * BIG_ENDIAN
+ * BYTE_ORDER
+ *
+ * And functions / macros :
+ *
+ * bswap_16()
+ * bswap_32()
+ * bswap_64()
+ *
+ * htobe16()
+ * htole16()
+ * be16toh()
+ * le16toh()
+ *
+ * htobe32()
+ * htole32()
+ * be32toh()
+ * le32toh()
+ *
+ * htobe64()
+ * htole64()
+ * be64toh()
+ * le64toh()
+ */
+
#ifndef _COMPAT_ENDIAN_H
#define _COMPAT_ENDIAN_H
#define LITTLE_ENDIAN __LITTLE_ENDIAN
#define BIG_ENDIAN __BIG_ENDIAN
-#define PDP_ENDIAN __PDP_ENDIAN
#define BYTE_ORDER __BYTE_ORDER
#define betoh16(x) BE_16(x)
* My best guess at if you are big-endian or little-endian. This may
* need adjustment.
*/
-#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \
- __BYTE_ORDER == __LITTLE_ENDIAN) || \
+#if (defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && \
+ BYTE_ORDER == LITTLE_ENDIAN) || \
(defined(i386) || defined(__i386__) || defined(__i486__) || \
defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL))
# define HASH_LITTLE_ENDIAN 1
# define HASH_BIG_ENDIAN 0
-#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \
- __BYTE_ORDER == __BIG_ENDIAN) || \
+#elif (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && \
+ BYTE_ORDER == BIG_ENDIAN) || \
(defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel))
# define HASH_LITTLE_ENDIAN 0
# define HASH_BIG_ENDIAN 1