summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-01-24 09:41:51 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2016-01-24 09:41:51 (GMT)
commit3b234d26b7fc44a85c2e0e94932c4ef6e0ed0381 (patch)
tree715f65b0847fdae93d0e82b8301c270c5060cf24
parent932875fc8df4ed1b509c18f93f206ad343bed857 (diff)
downloadnsgenbind-3b234d26b7fc44a85c2e0e94932c4ef6e0ed0381.tar.gz
nsgenbind-3b234d26b7fc44a85c2e0e94932c4ef6e0ed0381.tar.bz2
Improve strndup detection
-rw-r--r--src/utils.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils.h b/src/utils.h
index 508d1c1..6d45ca5 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -36,7 +36,9 @@ FILE *genb_fopen_tmp(const char *fname);
*/
int genb_fclose_tmp(FILE *filef, const char *fname);
-#ifdef _WIN32
+#if (defined(_GNU_SOURCE) && !defined(__APPLE__) && !defined(_WIN32) || defined(__amigaos4__) || defined(__HAIKU__) || (defined(_POSIX_C_SOURCE) && ((_POSIX_C_SOURCE - 0) >= 200809L)))
+#undef NEED_STRNDUP
+#else
#define NEED_STRNDUP 1
char *strndup(const char *s, size_t n);
#endif