Skip to content

Commit 24b7bf2

Browse files
eggertPo Lu
authored and
Po Lu
committed
More-permanent fix for build with Android NDK r10b
* configure.ac (gl_cv_header_working_endian_h): Remove temporary workaround for Android. * lib/endian.in.h: Copy latest version from Gnulib.
1 parent 7f415f7 commit 24b7bf2

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

configure.ac

-6
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ if test "$XCONFIGURE" = "android"; then
4949
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=32"
5050
enable_largefile=no
5151
enable_year2038=no])
52-
# Further, endian.h is not guaranteed to define every function that
53-
# Gnulib seeks to replace, but Gnulib tests are not prepared for
54-
# such versions of endian.h as only define a subset of the functions
55-
# whose presence it tests. Force such tests to succeed as a stopgap
56-
# measure.
57-
gl_cv_header_working_endian_h=yes
5852
fi
5953

6054
dnl Set emacs_config_options to the options of 'configure', quoted for the shell,

lib/endian.in.h

+17-1
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ _GL_INLINE_HEADER_BEGIN
6969
# define BYTE_ORDER LITTLE_ENDIAN
7070
#endif
7171

72-
/* Make sure function-like macros get undefined. */
7372
#if @HAVE_ENDIAN_H@
73+
74+
/* Make sure we don't have any system definitions. */
7475
# undef be16toh
7576
# undef be32toh
7677
# undef be64toh
@@ -83,6 +84,21 @@ _GL_INLINE_HEADER_BEGIN
8384
# undef htole16
8485
# undef htole32
8586
# undef htole64
87+
88+
/* Define our own. */
89+
# define be16toh rpl_endian_be16toh
90+
# define be32toh rpl_endian_be32toh
91+
# define be64toh rpl_endian_be64toh
92+
# define htobe16 rpl_endian_htobe16
93+
# define htobe32 rpl_endian_htobe32
94+
# define htobe64 rpl_endian_htobe64
95+
# define le16toh rpl_endian_le16toh
96+
# define le32toh rpl_endian_le32toh
97+
# define le64toh rpl_endian_le64toh
98+
# define htole16 rpl_endian_htole16
99+
# define htole32 rpl_endian_htole32
100+
# define htole64 rpl_endian_htole64
101+
86102
#endif
87103

88104
#ifdef __cplusplus

0 commit comments

Comments
 (0)