hopefully fix the _GNU_SOURCE mess

svn path=/trunk/netsurf/; revision=10487
This commit is contained in:
Vincent Sanders 2010-04-26 09:27:16 +00:00
parent a2c1afcc32
commit bd9c0d9a7e
2 changed files with 19 additions and 9 deletions

View File

@ -23,15 +23,30 @@
/* Try to detect which features the target OS supports */
#if (defined(_GNU_SOURCE))
#define HAVE_STRNDUP
#else
#undef HAVE_STRNDUP
char *strndup(const char *s, size_t n);
#endif
#if (defined(_GNU_SOURCE))
#define HAVE_STRCASESTR
#if (!(defined(__NetBSD__) || defined(__OpenBSD__)) \
|| defined(riscos) || defined(__APPLE__) || defined(_WIN32))
#else
#undef HAVE_STRCASESTR
char *strcasestr(const char *haystack, const char *needle);
#endif
/* For some reason, UnixLib defines this unconditionally.
* Assume we're using UnixLib if building for RISC OS. */
#if (defined(_GNU_SOURCE) || defined(riscos))
#define HAVE_STRCHRNUL
#else
#undef HAVE_STRCHRNUL
char *strchrnul(const char *s, int c);
#endif
#define HAVE_UTSNAME
#if (defined(_WIN32))
#undef HAVE_UTSNAME
@ -52,13 +67,6 @@ char *strcasestr(const char *haystack, const char *needle);
#undef HAVE_STDOUT
#endif
#define HAVE_STRCHRNUL
/* For some reason, UnixLib defines this unconditionally.
* Assume we're using UnixLib if building for RISC OS. */
#if !(defined(riscos))
#undef HAVE_STRCHRNUL
char *strchrnul(const char *s, int c);
#endif
/* This section toggles build options on and off.
* Simply undefine a symbol to turn the relevant feature off.

View File

@ -295,6 +295,7 @@ char *strcasestr(const char *haystack, const char *needle)
#endif
#ifndef HAVE_STRNDUP
/**
* Duplicate up to n characters of a string.
@ -317,6 +318,7 @@ char *strndup(const char *s, size_t n)
return s2;
}
#endif
#ifndef HAVE_STRCHRNUL