This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH v2 2/2] Port strnstr.c to newlib.
On 25/08/17 08:15, Sichen Zhao wrote:
---
newlib/libc/include/string.h | 3 +++
newlib/libc/string/Makefile.am | 1 +
newlib/libc/string/strnstr.c | 13 ++++++-------
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h
index 7833aa1..304d8a5 100644
--- a/newlib/libc/include/string.h
+++ b/newlib/libc/include/string.h
@@ -121,6 +121,9 @@ size_t _EXFUN(strnlen,(const char *, size_t));
#if __BSD_VISIBLE
char *_EXFUN(strsep,(char **, const char *));
#endif
+#if __BSD_VISIBLE
+char *_EXFUN(strnstr,(const char *, const char *, size_t));
+#endif
I would rather use the FreeBSD prototype:
#if __BSD_VISIBLE
char *strnstr(const char *, const char *, size_t) __pure;
#endif
This makes the strnstr.c modifications unnecessary. I think the _EXFUN()
stuff is deprecated.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.