From 6f7ae529ad402902fb731d2144f3e914b3eaed3f Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 22 Oct 2012 15:16:48 +0000 Subject: * libc/include/string.h (strdup, strndup): Declare if not __STRICT_ANSI__ or _XOPEN_SOURCE is defined appropriately. --- newlib/libc/include/string.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'newlib/libc/include/string.h') 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 #include +#include #define __need_size_t #include @@ -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 -- cgit v1.2.3