From: Denys Vlasenko Date: Thu, 1 Sep 2011 14:31:48 +0000 (+0200) Subject: Add stpcpy to autoconf machinery X-Git-Tag: v4.7~263 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a295bc97fd2ba9e6dc02f382dc87bc8705dc4d0;p=strace Add stpcpy to autoconf machinery * configure.ac: Add stpcpy to AC_CHECK_FUNCS. * defs.h: Frame stpcpy with "if !defined HAVE_STPCPY". * util.c: Likewise. Signed-off-by: Denys Vlasenko --- diff --git a/configure.ac b/configure.ac index 0a4f8916..789a997d 100644 --- a/configure.ac +++ b/configure.ac @@ -235,6 +235,7 @@ AC_CHECK_FUNCS([ \ strsignal \ sys_siglist \ _sys_siglist \ + stpcpy \ ]) AC_CHECK_HEADERS([ \ inttypes.h \ diff --git a/defs.h b/defs.h index 59d4c7a4..dd8fc648 100644 --- a/defs.h +++ b/defs.h @@ -681,12 +681,14 @@ extern void tv_sub(struct timeval *, struct timeval *, struct timeval *); extern void tv_mul(struct timeval *, struct timeval *, int); extern void tv_div(struct timeval *, struct timeval *, int); +#if !defined HAVE_STPCPY /* Some libc have stpcpy, some don't. Sigh... * Roll our private implementation... */ #undef stpcpy #define stpcpy strace_stpcpy extern char *stpcpy(char *dst, const char *src); +#endif #ifdef SUNOS4 extern int fixvfork(struct tcb *); diff --git a/util.c b/util.c index 0277deb8..7d1af702 100644 --- a/util.c +++ b/util.c @@ -164,6 +164,7 @@ xlookup(const struct xlat *xlat, int val) return NULL; } +#if !defined HAVE_STPCPY char * stpcpy(char *dst, const char *src) { @@ -171,6 +172,7 @@ stpcpy(char *dst, const char *src) dst++; return dst; } +#endif /* * Generic ptrace wrapper which tracks ESRCH errors