summaryrefslogtreecommitdiff
path: root/src/fns.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2023-04-01 10:53:50 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2023-04-01 11:00:34 +0200
commitf5891da70aae4deb465e8f193a172fbad0b4485f (patch)
treeb2fa69c9001a1e952e6a4978768b7cf5ed004114 /src/fns.c
parent4bd1fc59664273c571aba8543940768c68eb336b (diff)
downloademacs-f5891da70aae4deb465e8f193a172fbad0b4485f.tar.gz
; * src/fns.c: Use if instead of #ifdef
* src/fns.c (HAVE_FAST_UNALIGNED_ACCESS, load_unaligned_size_t): Always define these. (Fstring_lessp): Use if instead of #ifdef.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/fns.c b/src/fns.c
index 47def5c43b4..e92ef7e4c81 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -452,6 +452,9 @@ If string STR1 is greater, the value is a positive number N;
|| defined __s390__ || defined __s390x__) \
&& defined __OPTIMIZE__
#define HAVE_FAST_UNALIGNED_ACCESS 1
+#else
+#define HAVE_FAST_UNALIGNED_ACCESS 0
+#endif
/* Load a word from a possibly unaligned address. */
static inline size_t
@@ -462,8 +465,6 @@ load_unaligned_size_t (const void *p)
return x;
}
-#endif
-
DEFUN ("string-lessp", Fstring_lessp, Sstring_lessp, 2, 2, 0,
doc: /* Return non-nil if STRING1 is less than STRING2 in lexicographic order.
Case is significant.
@@ -504,18 +505,16 @@ Symbols are also allowed; their print names are used instead. */)
/* String data is normally allocated with word alignment, but
there are exceptions (notably pure strings) so we restrict the
wordwise skipping to safe architectures. */
-#ifdef HAVE_FAST_UNALIGNED_ACCESS
+ if (HAVE_FAST_UNALIGNED_ACCESS)
{
/* First compare entire machine words. */
int ws = sizeof (size_t);
const char *w1 = SSDATA (string1);
const char *w2 = SSDATA (string2);
- while (b < nb - ws + 1
- && (load_unaligned_size_t (w1 + b)
- == load_unaligned_size_t (w2 + b)))
+ while (b < nb - ws + 1 && load_unaligned_size_t (w1 + b)
+ == load_unaligned_size_t (w2 + b))
b += ws;
}
-#endif
/* Scan forward to the differing byte. */
while (b < nb && SREF (string1, b) == SREF (string2, b))