summaryrefslogtreecommitdiff
path: root/src/sh
diff options
context:
space:
mode:
authorStephen Webb <swebb@blackberry.com>2020-06-11 17:52:49 -0400
committerDave Watson <dade.watson@gmail.com>2020-06-18 13:42:19 -0700
commit12e70a59df9a2e1c436c79c1dba941ca555db843 (patch)
treed0f9cc95ba9c54d22f8de5fbbf731f076ebadd5c /src/sh
parent77dfbd60e715399f06b3e823fdffa5d9c658caf2 (diff)
downloadlibunwind-12e70a59df9a2e1c436c79c1dba941ca555db843.tar.gz
Rationalize endianness macros
Extend the endianness macros to support systems that define them in <sys/param.h> and replace the use of names that violate ISO/IEC 9899. Rename endianness macros used in code to use properly-namespaced macros for portability and cross-hosting compatibility. Add inline functions to perform common operations with the macros.
Diffstat (limited to 'src/sh')
-rw-r--r--src/sh/Gcreate_addr_space.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sh/Gcreate_addr_space.c b/src/sh/Gcreate_addr_space.c
index 6ca3a384..cc6bf658 100644
--- a/src/sh/Gcreate_addr_space.c
+++ b/src/sh/Gcreate_addr_space.c
@@ -36,8 +36,7 @@ unw_create_addr_space (unw_accessors_t *a, int byte_order)
unw_addr_space_t as;
/* SH supports little-endian and big-endian. */
- if (byte_order != 0 && byte_order != __LITTLE_ENDIAN
- && byte_order != __BIG_ENDIAN)
+ if (byte_order != 0 && byte_order_is_valid(byte_order) == 0)
return NULL;
as = malloc (sizeof (*as));
@@ -49,7 +48,7 @@ unw_create_addr_space (unw_accessors_t *a, int byte_order)
as->acc = *a;
/* Default to little-endian for SH. */
- if (byte_order == 0 || byte_order == __LITTLE_ENDIAN)
+ if (byte_order == 0 || byte_order == UNW_LITTLE_ENDIAN)
as->big_endian = 0;
else
as->big_endian = 1;