]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/newlib-tumbl.git/commitdiff
* libc/include/string.h (strdup, strndup): Declare if not
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 22 Oct 2012 15:16:48 +0000 (15:16 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 22 Oct 2012 15:16:48 +0000 (15:16 +0000)
__STRICT_ANSI__ or _XOPEN_SOURCE is defined appropriately.

newlib/ChangeLog
newlib/libc/include/string.h

index 17391bd514c1731c0b5c726569ee322b57193399..1f175b0c9e9872b81b630d9a9fb4887d3a29fb42 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-22  Jon TURNEY  <jon.turney@dronecode.org.uk>
+
+       * libc/include/string.h (strdup, strndup): Declare if not
+       __STRICT_ANSI__ or _XOPEN_SOURCE is defined appropriately.
+
 2012-10-22  Jon TURNEY  <jon.turney@dronecode.org.uk>
 
        * libc/include/stdlib.h (strtof, strtoll, strtoull, strtold):Prototype
index ef0402fb8ac50fe1251e7aed407e3855d3d890d1..fad0ef3d02e3ee8c4cc92556b2a5914e5889bae4 100644 (file)
@@ -10,6 +10,7 @@
 #include "_ansi.h"
 #include <sys/reent.h>
 #include <sys/cdefs.h>
+#include <sys/features.h>
 
 #define __need_size_t
 #include <stddef.h>
@@ -65,9 +66,17 @@ char         *_EXFUN(stpncpy,(char *, const char *, size_t));
 int     _EXFUN(strcasecmp,(const char *, const char *));
 char   *_EXFUN(strcasestr,(const char *, const char *));
 char   *_EXFUN(strchrnul,(const char *, int));
+#endif
+#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 500)
 char   *_EXFUN(strdup,(const char *));
+#endif
+#ifndef __STRICT_ANSI__
 char   *_EXFUN(_strdup_r,(struct _reent *, const char *));
+#endif
+#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 700)
 char   *_EXFUN(strndup,(const char *, size_t));
+#endif
+#ifndef __STRICT_ANSI__
 char   *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t));
 /* There are two common strerror_r variants.  If you request
    _GNU_SOURCE, you get the GNU version; otherwise you get the POSIX