From 2d57934be8a46dadd5b149e66acc0477bea8b975 Mon Sep 17 00:00:00 2001 From: Niclas Rosenvik Date: Wed, 13 Nov 2019 17:58:06 +0000 Subject: fix compatability macros setup for NetBSD --- utils/config.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/config.h b/utils/config.h index d0ec21c53..d3ec32628 100644 --- a/utils/config.h +++ b/utils/config.h @@ -21,6 +21,13 @@ #include +#if defined(__NetBSD__) +#include +#if (defined(__NetBSD_Version__) && __NetBSD_Prereq__(8,0,0)) +#define NetBSD_v8 +#endif +#endif + /* Try to detect which features the target OS supports */ #if (defined(_GNU_SOURCE) && \ @@ -38,6 +45,7 @@ char *strndup(const char *s, size_t n); #if ((defined(_GNU_SOURCE) || \ defined(__APPLE__) || \ defined(__HAIKU__) || \ + defined(__NetBSD__) || \ defined(__OpenBSD__)) && \ !defined(__serenity__)) #define HAVE_STRCASESTR @@ -66,7 +74,9 @@ char *strcasestr(const char *haystack, const char *needle); /* For some reason, UnixLib defines this unconditionally. Assume we're using * UnixLib if building for RISC OS. */ -#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) || defined(__riscos__)) +#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) || \ + defined(__riscos__) || \ + defined(NetBSD_v8)) #define HAVE_STRCHRNUL #else #undef HAVE_STRCHRNUL -- cgit v1.2.3