summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/sparc/bits/endian.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/sparc/bits/endian.h')
-rw-r--r--libc/sysdeps/linux/sparc/bits/endian.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/sparc/bits/endian.h b/libc/sysdeps/linux/sparc/bits/endian.h
index 68fc68de6..8acfdf5df 100644
--- a/libc/sysdeps/linux/sparc/bits/endian.h
+++ b/libc/sysdeps/linux/sparc/bits/endian.h
@@ -1,7 +1,12 @@
-/* SPARC is big-endian. */
+/* Sparc is big-endian, but v9 supports endian conversion on loads/stores
+ and GCC supports such a mode. Be prepared. */
#ifndef _ENDIAN_H
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
#endif
-#define __BYTE_ORDER __BIG_ENDIAN
+#ifdef __LITTLE_ENDIAN__
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#else
+# define __BYTE_ORDER __BIG_ENDIAN
+#endif