summaryrefslogtreecommitdiffstats
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-10-22 15:16:48 +0000
committerCorinna Vinschen <corinna@vinschen.de>2012-10-22 15:16:48 +0000
commit6f7ae529ad402902fb731d2144f3e914b3eaed3f (patch)
tree96e35b9a5ba9c2e647f2bda5a2b716a91a18e2d8 /newlib
parente0543989801aea12c95505e4d575153d88ecd3f1 (diff)
downloadcygnal-6f7ae529ad402902fb731d2144f3e914b3eaed3f.tar.gz
cygnal-6f7ae529ad402902fb731d2144f3e914b3eaed3f.tar.bz2
cygnal-6f7ae529ad402902fb731d2144f3e914b3eaed3f.zip
* libc/include/string.h (strdup, strndup): Declare if not
__STRICT_ANSI__ or _XOPEN_SOURCE is defined appropriately.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/include/string.h9
2 files changed, 14 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 17391bd51..1f175b0c9 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,5 +1,10 @@
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
if not __STRICT_ANSI__ or stdc version C99 or greater.
diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h
index ef0402fb8..fad0ef3d0 100644
--- a/newlib/libc/include/string.h
+++ b/newlib/libc/include/string.h
@@ -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