summaryrefslogtreecommitdiff
path: root/src/string_func.h
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-08-24 17:02:21 +0000
committerglx <glx@openttd.org>2008-08-24 17:02:21 +0000
commit4bb40a7d4431b32016353d197c9fa8f59fe119a9 (patch)
tree4d583b36854c8c29c4b2c087d4a80ea73477af39 /src/string_func.h
parent7ceb1252a2fc36adbe65ea49918255120a83c85a (diff)
downloadopenttd-4bb40a7d4431b32016353d197c9fa8f59fe119a9.tar.xz
(svn r14154) -Fix (r14153): strndup is a GNU extension, so it doesn't exist on all platforms
Diffstat (limited to 'src/string_func.h')
-rw-r--r--src/string_func.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/string_func.h b/src/string_func.h
index 82530ae65..7bc2d6c95 100644
--- a/src/string_func.h
+++ b/src/string_func.h
@@ -156,4 +156,9 @@ static inline bool IsWhitespace(WChar c)
;
}
-#endif /* STRING_FUNC_H */
+#ifndef _GNU_SOURCE
+/* strndup is a GNU extension */
+char *strndup(const char *s, size_t len);
+#endif /* WIN32 || SUNOS */
+
+#endif /* !_GNU_SOURCE */