Commit 955f9ae9bd25ceb59775463e04c0276209387b67

Vicent Marti 2011-03-16T01:06:15

Export `git_strarray_free` instead of inlining That way non-C bindings can use it.

diff --git a/include/git2/common.h b/include/git2/common.h
index 11a08f8..f904521 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -165,14 +165,7 @@ typedef struct {
 	size_t count;
 } git_strarray;
 
-GIT_INLINE(void) git_strarray_free(git_strarray *array)
-{
-	size_t i;
-	for (i = 0; i < array->count; ++i)
-		free(array->strings[i]);
-
-	free(array->strings);
-}
+GIT_EXTERN(void) git_strarray_free(git_strarray *array);
 
 /** @} */
 GIT_END_DECL
diff --git a/src/util.c b/src/util.c
index c9a8e5f..bfc4f7b 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3,6 +3,15 @@
 #include <stdarg.h>
 #include <stdio.h>
 
+void git_strarray_free(git_strarray *array)
+{
+	size_t i;
+	for (i = 0; i < array->count; ++i)
+		free(array->strings[i]);
+
+	free(array->strings);
+}
+
 int git__fmt(char *buf, size_t buf_sz, const char *fmt, ...)
 {
 	va_list va;