From 8fbac937fbaf0d74ded6eebdf6acd4636d7b00ea Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 15 Mar 2023 15:38:19 +0800 Subject: [PATCH] Port to systems without endian.h * lib-src/asset-directory-tool.c (main_2): Port to systems without htole32. --- lib-src/asset-directory-tool.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib-src/asset-directory-tool.c b/lib-src/asset-directory-tool.c index e53398eceb0..239ab083b66 100644 --- a/lib-src/asset-directory-tool.c +++ b/lib-src/asset-directory-tool.c @@ -22,7 +22,7 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include +#include #include #include #include @@ -197,7 +197,11 @@ main_2 (int fd, struct directory_tree *tree, size_t *offset) croak ("write"); /* Write the offset. */ - output = htole32 (tree->offset); +#ifdef WORDS_BIGENDIAN + output = bswap_32 (tree->offset); +#else + output = tree->offset; +#endif if (write (fd, &output, 4) < 1) croak ("write"); size += 4; -- 2.39.2