[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/android 8fbac937fba: Port to systems without endian.h
From: |
Po Lu |
Subject: |
feature/android 8fbac937fba: Port to systems without endian.h |
Date: |
Wed, 15 Mar 2023 03:38:44 -0400 (EDT) |
branch: feature/android
commit 8fbac937fbaf0d74ded6eebdf6acd4636d7b00ea
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
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
<https://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
-#include <endian.h>
+#include <byteswap.h>
#include <stdlib.h>
#include <dirent.h>
#include <string.h>
@@ -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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- feature/android 8fbac937fba: Port to systems without endian.h,
Po Lu <=