Export `git_strarray_free` instead of inlining That way non-C bindings can use it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
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;