From 2de9e2d16b058971bf22e18062fc26278098dfb0 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 18 May 2010 21:17:25 +0000 Subject: (svn r19853) -Fix [FS#3840]: revert r19781 and apply a more sensible version with the same effect --- src/os/unix/crashlog_unix.cpp | 4 ++++ src/stdafx.h | 3 --- src/string_func.h | 9 +++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/os/unix/crashlog_unix.cpp b/src/os/unix/crashlog_unix.cpp index ee86cb5ee..5f17fafdb 100644 --- a/src/os/unix/crashlog_unix.cpp +++ b/src/os/unix/crashlog_unix.cpp @@ -27,6 +27,10 @@ # include #endif +#if defined(__NetBSD__) +#include +#endif + /** * Unix implementation for the crash logger. */ diff --git a/src/stdafx.h b/src/stdafx.h index b96162266..8a8595722 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -24,9 +24,6 @@ #elif defined(__NDS__) #include #define TROUBLED_INTS -#elif defined(__NetBSD__) - #include - #define _GNU_SOURCE #endif /* It seems that we need to include stdint.h before anything else diff --git a/src/string_func.h b/src/string_func.h index 2ff5f0439..942873593 100644 --- a/src/string_func.h +++ b/src/string_func.h @@ -246,13 +246,18 @@ static inline bool IsWhitespace(WChar c) ; } -#ifndef _GNU_SOURCE +/* Needed for NetBSD version (so feature) testing */ +#ifdef __NetBSD__ +#include +#endif + +#if !defined(_GNU_SOURCE) && !(defined(__NetBSD_Version__) && 400000000 < __NetBSD_Version__ ) /* strndup is a GNU extension */ char *strndup(const char *s, size_t len); #endif /* !_GNU_SOURCE */ /* strcasestr is available for _GNU_SOURCE, BSD and some Apple */ -#if defined(_GNU_SOURCE) || (defined(__BSD_VISIBLE) && __BSD_VISIBLE) || (defined(__APPLE__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))) +#if defined(_GNU_SOURCE) || (defined(__BSD_VISIBLE) && __BSD_VISIBLE) || (defined(__APPLE__) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))) || _NETBSD_SOURCE # undef DEFINE_STRCASESTR #else # define DEFINE_STRCASESTR -- cgit v1.2.3-54-g00ecf