From 5a58a6bc477f290ee0b8a6111e92df56ff538719 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 2 May 2023 08:16:00 +0800 Subject: Port Android port to older Android systems * exec/config.h.in: Autoheader. * exec/configure.ac: Check for declarations of stpcpy and stpncpy. * exec/exec.c (stpcpy, stpncpy): Use replacements if declarations are not present; this happens when a new Android NDK is building for an old version of Android. --- exec/exec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'exec/exec.c') diff --git a/exec/exec.c b/exec/exec.c index df8c9430236..7f2cc75338b 100644 --- a/exec/exec.c +++ b/exec/exec.c @@ -50,7 +50,7 @@ along with GNU Emacs. If not, see . */ /* Define replacements for required string functions. */ -#ifndef HAVE_STPCPY +#if !defined HAVE_STPCPY || !defined HAVE_DECL_STPCPY /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ @@ -72,14 +72,14 @@ rpl_stpcpy (char *dest, const char *src) } #define stpcpy rpl_stpcpy -#endif /* !HAVE_STPCPY */ +#endif /* !defined HAVE_STPCPY || !defined HAVE_DECL_STPCPY */ -#ifndef HAVE_STPNCPY +#if !defined HAVE_STPNCPY || !defined HAVE_DECL_STPNCPY /* Copy no more than N bytes of SRC to DST, returning a pointer past the last non-NUL byte written into DST. */ -char * +static char * rpl_stpncpy (char *dest, const char *src, size_t n) { char c, *s; @@ -140,7 +140,7 @@ rpl_stpncpy (char *dest, const char *src, size_t n) } #define stpncpy rpl_stpncpy -#endif /* !HAVE_STPNCPY */ +#endif /* !defined HAVE_STPNCPY || !defined HAVE_DECL_STPNCPY */ -- cgit v1.2.1