]> git.eshelyaron.com Git - emacs.git/commitdiff
Use Gnulib workaround for Android strnlen bug
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 12 Jul 2024 16:23:30 +0000 (17:23 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 17 Jul 2024 21:53:26 +0000 (23:53 +0200)
The workaround for the Android 5.0 (API 21) strnlen bug
is now done in m4/strnlen.m4, taken from Gnulib, so
there is no need for Emacs to have its own workaround.
* configure.ac (ORIGINAL_AC_FUNC_STRNLEN, AC_FUNC_STRNLEN):
Remove.

(cherry picked from commit 2067c255e677f77eaf27dc992400111d8ac59bfd)

configure.ac

index 50c04b81bc17b48baeded2557ca68ac7d45982d0..16de77f0e6f3ec92df28ffd6116749a98298a921 100644 (file)
@@ -1611,30 +1611,6 @@ AC_DEFUN([gl_TYPE_OFF64_T],
   [HAVE_OFF64_T=1
    AC_SUBST([HAVE_OFF64_T])])
 
-# `strnlen' cannot accept nlen greater than the size of the object S
-# on Android 5.0 and earlier.
-m4_define([ORIGINAL_AC_FUNC_STRNLEN], m4_defn([AC_FUNC_STRNLEN]))
-AC_DEFUN([AC_FUNC_STRNLEN], [
-AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_CACHE_CHECK([for strnlen capable of accepting large limits],
-  [emacs_cv_func_strnlen_working],
-  [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[
-  volatile size_t (*strnlen_pointer) (const char *s, size_t) = &strnlen;
-  if ((*strnlen_pointer) ("", -1) != 0)
-    return 1;
-  return 0;
-]])],[emacs_cv_func_strnlen_working=yes],
-     [emacs_cv_func_strnlen_working=no],
-     [# Guess no on Android 21 and earlier, yes elsewhere.
-      AS_IF([test -n "$ANDROID_SDK" && test "$ANDROID_SDK" -lt 22],
-        [emacs_cv_func_strnlen_working=no],
-       [emacs_cv_func_strnlen_working='guessing yes'])])])
-AS_IF([test "$emacs_cv_func_strnlen_working" != "no"],
-  [ORIGINAL_AC_FUNC_STRNLEN],
-  [ac_cv_func_strnlen_working=no
-   AC_LIBOBJ([strnlen])])])
-
 # Initialize gnulib right after choosing the compiler.
 dnl Amongst other things, this sets AR and ARFLAGS.
 gl_EARLY