On Wed, Feb 13, 2013 at 03:46:33PM +0000, Niclas Zeising wrote: > Author: zeising (doc,ports committer) > Date: Wed Feb 13 15:46:33 2013 > New Revision: 246766 > URL: http://svnweb.freebsd.org/changeset/base/246766 > > Log: > Add strchrnul(), a GNU function similar to strchr(), except that it returns > a pointer to the end of the string, rather than NULL, if the character was > not found. > > Approved by: theraven > > Added: > head/lib/libc/string/strchrnul.c (contents, props changed) > Modified: > head/include/string.h > head/lib/libc/string/Makefile.inc > head/lib/libc/string/Symbol.map > head/lib/libc/string/strchr.3 > > Modified: head/include/string.h > ============================================================================== > --- head/include/string.h Wed Feb 13 15:43:15 2013 (r246765) > +++ head/include/string.h Wed Feb 13 15:46:33 2013 (r246766) > @@ -74,6 +74,9 @@ char *strcasestr(const char *, const cha > #endif > char *strcat(char * __restrict, const char * __restrict); > char *strchr(const char *, int) __pure; > +#if defined(_GNU_SOURCE) > +char *strchrnul(const char*, int) __pure; > +#endif The GNU_SOURCE namespace is not present on the FreeBSD. We use #if __BSD_VISIBLE namespace delineation for the extensions not covered by any standard namespaces supported by the FreeBSD headers.
The only place in the system where system-native headers do check for _GNU_SOURCE, the code also checks for _BSD_SOURCE.
pgpLmMHGUQMzE.pgp
Description: PGP signature