summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/depend/depend.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/depend/depend.cpp b/src/depend/depend.cpp
index 9321e573b..a5d35c635 100644
--- a/src/depend/depend.cpp
+++ b/src/depend/depend.cpp
@@ -107,6 +107,23 @@ static char *strecat(char *dst, const char *src, const char *last)
return strecpy(dst, src, last);
}
+#if defined(__CYGWIN__)
+/**
+ * Version of strdup copied from glibc.
+ * Duplicate S, returning an identical malloc'd string.
+ * @param s The string to duplicate.
+ */
+char *
+strdup (const char *s)
+{
+ size_t len = strlen(s) + 1;
+ void *n = malloc(len);
+
+ if (n == NULL) return NULL;
+ return (char *) memcpy(n, s, len);
+}
+#endif
+
/**
* Version of the standard free that accepts const pointers.
* @param ptr The data to free.