]> granicus.if.org Git - strace/commitdiff
Add stpcpy to autoconf machinery
authorDenys Vlasenko <dvlasenk@redhat.com>
Thu, 1 Sep 2011 14:31:48 +0000 (16:31 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Thu, 1 Sep 2011 14:31:48 +0000 (16:31 +0200)
* 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 <dvlasenk@redhat.com>
configure.ac
defs.h
util.c

index 0a4f8916a1101a35a1f9ce3a182509eb1293848b..789a997dde4ceff621101c922df00abe21be6b16 100644 (file)
@@ -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 59d4c7a4df8a87c6224ad8e9b00fbf045210401d..dd8fc648870ba100d32937138a9f1b0eae3db4c8 100644 (file)
--- 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 0277deb8bdc5c7bc5902ec73e570112f12318a1c..7d1af70281ae0187b920fa46cdef570580bdc09d 100644 (file)
--- 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