From bd9c0d9a7e03dff94904000384b5a03ce13d6f29 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 26 Apr 2010 09:27:16 +0000 Subject: hopefully fix the _GNU_SOURCE mess svn path=/trunk/netsurf/; revision=10487 --- utils/config.h | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'utils/config.h') diff --git a/utils/config.h b/utils/config.h index ba6d9b464..4a4fa069c 100644 --- a/utils/config.h +++ b/utils/config.h @@ -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. -- cgit v1.2.3