summaryrefslogtreecommitdiff
path: root/src/lj_str.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-11-28 17:22:45 +0100
committerMike Pall <mike>2010-11-28 17:22:45 +0100
commit2033d6310bbda7dc5554dd3c473836743929f2c3 (patch)
tree4d3682497731875a1f8a8fdd52f0bbf24f86810f /src/lj_str.c
parent24186e05e66550951002ccca6f7fb4782c5c0319 (diff)
downloadluajit2-2033d6310bbda7dc5554dd3c473836743929f2c3.tar.gz
Add shorter defines for endianess checks.
Diffstat (limited to 'src/lj_str.c')
-rw-r--r--src/lj_str.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lj_str.c b/src/lj_str.c
index 5e69ed0d..19f9d191 100644
--- a/src/lj_str.c
+++ b/src/lj_str.c
@@ -29,7 +29,7 @@ int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b)
uint32_t va = *(const uint32_t *)(strdata(a)+i);
uint32_t vb = *(const uint32_t *)(strdata(b)+i);
if (va != vb) {
-#if LJ_ARCH_ENDIAN == LUAJIT_LE
+#if LJ_LE
va = lj_bswap(va); vb = lj_bswap(vb);
#endif
i -= n;
@@ -53,7 +53,7 @@ static LJ_AINLINE int str_fastcmp(const char *a, const char *b, MSize len)
uint32_t v = *(const uint32_t *)(a+i) ^ *(const uint32_t *)(b+i);
if (v) {
i -= len;
-#if LJ_ARCH_ENDIAN == LUAJIT_LE
+#if LJ_LE
return (int32_t)i >= -3 ? (v << (32+(i<<3))) : 1;
#else
return (int32_t)i >= -3 ? (v >> (32+(i<<3))) : 1;