summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/string/sh64/memset.S4
-rw-r--r--libc/string/sh64/strcpy.S6
-rw-r--r--libc/sysdeps/linux/sh/bits/kernel_stat.h8
3 files changed, 11 insertions, 7 deletions
diff --git a/libc/string/sh64/memset.S b/libc/string/sh64/memset.S
index e1679230b..d87879717 100644
--- a/libc/string/sh64/memset.S
+++ b/libc/string/sh64/memset.S
@@ -9,7 +9,9 @@
! Copyright 2002 SuperH Ltd.
!
-#ifdef __LITTLE_ENDIAN__
+#include <endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define SHHI shlld
#define SHLO shlrd
#else
diff --git a/libc/string/sh64/strcpy.S b/libc/string/sh64/strcpy.S
index faa071c50..f662cc859 100644
--- a/libc/string/sh64/strcpy.S
+++ b/libc/string/sh64/strcpy.S
@@ -6,7 +6,9 @@
!
! SH5 code Copyright 2002 SuperH Ltd.
-#ifdef __LITTLE_ENDIAN__
+#include <endian.h>
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define SHHI shlld
#define SHLO shlrd
#else
@@ -67,7 +69,7 @@ no_lddst:
add r5, r63, r4
addi r0, 8, r0
shortstring:
-#ifndef __LITTLE_ENDIAN__
+#if __BYTE_ORDER != __LITTLE_ENDIAN
pta/l shortstring2,tr1
byterev r4,r4
#endif
diff --git a/libc/sysdeps/linux/sh/bits/kernel_stat.h b/libc/sysdeps/linux/sh/bits/kernel_stat.h
index cd818464d..c841b0cee 100644
--- a/libc/sysdeps/linux/sh/bits/kernel_stat.h
+++ b/libc/sysdeps/linux/sh/bits/kernel_stat.h
@@ -30,10 +30,10 @@ struct kernel_stat {
};
struct kernel_stat64 {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned char __pad0b[6];
unsigned short st_dev;
-#elif defined(__LITTLE_ENDIAN__)
+#elif (__BYTE_ORDER == __LITTLE_ENDIAN)
unsigned short st_dev;
unsigned char __pad0b[6];
#else
@@ -48,7 +48,7 @@ struct kernel_stat64 {
unsigned long st_uid;
unsigned long st_gid;
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned char __pad3b[6];
unsigned short st_rdev;
#else /* Must be little */
@@ -60,7 +60,7 @@ struct kernel_stat64 {
long long st_size;
unsigned long st_blksize;
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long __pad4; /* Future possible st_blocks hi bits */
unsigned long st_blocks; /* Number 512-byte blocks allocated. */
#else /* Must be little */