From 03bb3e863663a034434b000fbfce2de7e908ba24 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 24 Apr 2010 15:22:17 +0000 Subject: remove _GNU_SOURCE define from everywhere. strndup is not standard so provide an implementation. svn path=/trunk/netsurf/; revision=10474 --- utils/config.h | 13 ++----------- utils/url.c | 1 - utils/utf8.c | 1 - utils/utils.c | 2 -- 4 files changed, 2 insertions(+), 15 deletions(-) (limited to 'utils') diff --git a/utils/config.h b/utils/config.h index ba8d8227b..ba6d9b464 100644 --- a/utils/config.h +++ b/utils/config.h @@ -23,19 +23,10 @@ /* Try to detect which features the target OS supports */ -#define HAVE_STRNDUP -#if defined(__FreeBSD__) || (defined(__SRV4) && defined(__sun)) || \ - defined(__APPLE__) || defined(__HAIKU__) || defined(__BEOS__) \ - || defined(__OpenBSD__) || defined(_WIN32) - /* FreeBSD and Solaris do not have this function, so - * we implement it ourselves in util.c - */ -#undef HAVE_STRNDUP char *strndup(const char *s, size_t n); -#endif #define HAVE_STRCASESTR -#if (!(defined(_GNU_SOURCE) || defined(__NetBSD__) || defined(__OpenBSD__)) \ +#if (!(defined(__NetBSD__) || defined(__OpenBSD__)) \ || defined(riscos) || defined(__APPLE__) || defined(_WIN32)) #undef HAVE_STRCASESTR char *strcasestr(const char *haystack, const char *needle); @@ -64,7 +55,7 @@ char *strcasestr(const char *haystack, const char *needle); #define HAVE_STRCHRNUL /* For some reason, UnixLib defines this unconditionally. * Assume we're using UnixLib if building for RISC OS. */ -#if !(defined(_GNU_SOURCE) || defined(riscos)) +#if !(defined(riscos)) #undef HAVE_STRCHRNUL char *strchrnul(const char *s, int c); #endif diff --git a/utils/url.c b/utils/url.c index b02d77756..5cb7305e8 100644 --- a/utils/url.c +++ b/utils/url.c @@ -22,7 +22,6 @@ * URL parsing and joining (implementation). */ -#define _GNU_SOURCE /* for strdup() */ #include #include #include diff --git a/utils/utf8.c b/utils/utf8.c index f866562e1..d7fef5e7a 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -20,7 +20,6 @@ * UTF-8 manipulation functions (implementation). */ -#define _GNU_SOURCE /* for strndup */ #include #include #include diff --git a/utils/utils.c b/utils/utils.c index 175b33073..b0069365e 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -295,7 +295,6 @@ char *strcasestr(const char *haystack, const char *needle) #endif -#ifndef HAVE_STRNDUP /** * Duplicate up to n characters of a string. @@ -318,7 +317,6 @@ char *strndup(const char *s, size_t n) return s2; } -#endif #ifndef HAVE_STRCHRNUL -- cgit v1.2.3