Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit 4ed12bd

Browse files
committed
Rust: Add back endianness check via Linux endian.h for old GCC on MIPS
1 parent a4f8e8c commit 4ed12bd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/builtins/int_endianness.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@
105105

106106
#endif /* Windows */
107107

108+
#if defined(__linux__)
109+
#include <endian.h>
110+
111+
#if __BYTE_ORDER == __BIG_ENDIAN
112+
#define _YUGA_LITTLE_ENDIAN 0
113+
#define _YUGA_BIG_ENDIAN 1
114+
#elif __BYTE_ORDER == __LITTLE_ENDIAN
115+
#define _YUGA_LITTLE_ENDIAN 1
116+
#define _YUGA_BIG_ENDIAN 0
117+
#endif /* __BYTE_ORDER */
118+
119+
#endif /* GNU/Linux */
120+
108121
#endif /* Clang or GCC. */
109122

110123
/* . */

0 commit comments

Comments
 (0)