aboutsummaryrefslogtreecommitdiffstats
path: root/com32/include/klibc/endian.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-24 14:18:18 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-24 14:18:18 -0700
commita81fb89a445ae0dca286c861d8d51f705533df0d (patch)
treea8b2ae9b656b482c822fbdf75f0f16c1d43945a7 /com32/include/klibc/endian.h
parent3ac4d898c0dee05c6e2d00e4ecbf208dbd4915e8 (diff)
downloadsyslinux-a81fb89a445ae0dca286c861d8d51f705533df0d.tar.gz
syslinux-a81fb89a445ae0dca286c861d8d51f705533df0d.tar.xz
syslinux-a81fb89a445ae0dca286c861d8d51f705533df0d.zip
Fix building on a 64-bit system without a 32-bit system installedsyslinux-3.52-pre10syslinux-3.52
A bunch of glibc header files were bogusly included. We should not depend on having a 32-bit glibc installed, since we don't use it.
Diffstat (limited to 'com32/include/klibc/endian.h')
-rw-r--r--com32/include/klibc/endian.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/com32/include/klibc/endian.h b/com32/include/klibc/endian.h
new file mode 100644
index 00000000..7537a47e
--- /dev/null
+++ b/com32/include/klibc/endian.h
@@ -0,0 +1,38 @@
+/*
+ * klibc/endian.h
+ *
+ * Like <endian.h>, but export only double-underscore symbols
+ */
+
+#ifndef _KLIBC_ENDIAN_H
+#define _KLIBC_ENDIAN_H
+
+#define __LITTLE_ENDIAN /* we're on i386, littleendian */
+
+/* Linux' asm/byteorder.h defines either __LITTLE_ENDIAN or
+ __BIG_ENDIAN, but the glibc/BSD-ish macros expect both to be
+ defined with __BYTE_ORDER defining which is actually used... */
+
+#if defined(__LITTLE_ENDIAN)
+# undef __LITTLE_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#elif defined(__BIG_ENDIAN)
+# undef __BIG_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __BIG_ENDIAN
+#elif defined(__PDP_ENDIAN)
+# undef __PDP_ENDIAN
+# define __LITTLE_ENDIAN 1234
+# define __BIG_ENDIAN 4321
+# define __PDP_ENDIAN 3412
+# define __BYTE_ORDER __PDP_ENDIAN
+#else
+# error "Unknown byte order!"
+#endif
+
+#endif /* _KLIBC_ENDIAN_H */