summaryrefslogtreecommitdiff
path: root/src/string_func.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-21 15:56:19 +0000
committerrubidium <rubidium@openttd.org>2010-05-21 15:56:19 +0000
commite3df7caf18e6260dad84b8e4dd09f11886fbbe0e (patch)
treeb4f47a5188725c0bc8c66f8b5d14a59bf24707be /src/string_func.h
parentd8d37466afe02034fef2447a81fe4fe2469d352b (diff)
downloadopenttd-e3df7caf18e6260dad84b8e4dd09f11886fbbe0e.tar.xz
(svn r19874) -Fix [FS#3845]: NetBSD compilation was still broken in some cases (Krille)
Diffstat (limited to 'src/string_func.h')
-rw-r--r--src/string_func.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/string_func.h b/src/string_func.h
index 7787ee57c..f921397a0 100644
--- a/src/string_func.h
+++ b/src/string_func.h
@@ -251,10 +251,13 @@ static inline bool IsWhitespace(WChar c)
#include <sys/param.h>
#endif
-#if !defined(_GNU_SOURCE) && !(defined(__NetBSD_Version__) && 400000000 < __NetBSD_Version__ )
/* strndup is a GNU extension */
+#if defined(_GNU_SOURCE) || (defined(__NetBSD_Version__) && 400000000 <= __NetBSD_Version__)
+# undef DEFINE_STRNDUP
+#else
+# define DEFINE_STRNDUP
char *strndup(const char *s, size_t len);
-#endif /* !_GNU_SOURCE */
+#endif /* strndup is available */
/* 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))) || defined(_NETBSD_SOURCE)