Fix missing include for header files Some of our header files are not included at all by any of their implementing counter-parts. Including them inside of these files leads to some compile errors mostly due to unknown types because of missing includes. But there's also one case where a declared function does not match the implementation's prototype. Fix all these errors by fixing up the prototype and adding missing includes. This is preparatory work for fixing up missing includes in the implementation files.
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 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
diff --git a/src/clone.h b/src/clone.h
index 14ca5d4..fa20498 100644
--- a/src/clone.h
+++ b/src/clone.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_clone_h__
#define INCLUDE_clone_h__
+#include "git2/clone.h"
+
extern int git_clone__should_clone_local(const char *url, git_clone_local_t local);
#endif
diff --git a/src/diff_generate.h b/src/diff_generate.h
index 63e7f05..8b974be 100644
--- a/src/diff_generate.h
+++ b/src/diff_generate.h
@@ -7,6 +7,10 @@
#ifndef INCLUDE_diff_generate_h__
#define INCLUDE_diff_generate_h__
+#include "diff.h"
+#include "pool.h"
+#include "index.h"
+
enum {
GIT_DIFFCAPS_HAS_SYMLINKS = (1 << 0), /* symlinks on platform? */
GIT_DIFFCAPS_IGNORE_STAT = (1 << 1), /* use stat? */
diff --git a/src/diff_tform.h b/src/diff_tform.h
index 5bd9712..dbb4b54 100644
--- a/src/diff_tform.h
+++ b/src/diff_tform.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_diff_tform_h__
#define INCLUDE_diff_tform_h__
+#include "diff_file.h"
+
extern int git_diff_find_similar__hashsig_for_file(
void **out, const git_diff_file *f, const char *path, void *p);
diff --git a/src/fetch.h b/src/fetch.h
index 0412d4e..4cdbf3b 100644
--- a/src/fetch.h
+++ b/src/fetch.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_fetch_h__
#define INCLUDE_fetch_h__
+#include "git2/remote.h"
+
#include "netops.h"
int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts);
diff --git a/src/fetchhead.h b/src/fetchhead.h
index b03bd0f..69a1e86 100644
--- a/src/fetchhead.h
+++ b/src/fetchhead.h
@@ -7,6 +7,7 @@
#ifndef INCLUDE_fetchhead_h__
#define INCLUDE_fetchhead_h__
+#include "oid.h"
#include "vector.h"
typedef struct git_fetchhead_ref {
diff --git a/src/indexer.h b/src/indexer.h
index 702694b..cae3140 100644
--- a/src/indexer.h
+++ b/src/indexer.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_indexer_h__
#define INCLUDE_indexer_h__
-extern int git_indexer__set_fsync(git_indexer *idx, int do_fsync);
+#include "git2/indexer.h"
+
+extern void git_indexer__set_fsync(git_indexer *idx, int do_fsync);
#endif
diff --git a/src/patch_parse.h b/src/patch_parse.h
index 99eb458..5c4d04f 100644
--- a/src/patch_parse.h
+++ b/src/patch_parse.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_patch_parse_h__
#define INCLUDE_patch_parse_h__
+#include "patch.h"
+
typedef struct {
git_refcount rc;
diff --git a/src/refdb_fs.h b/src/refdb_fs.h
index 79e2968..a979383 100644
--- a/src/refdb_fs.h
+++ b/src/refdb_fs.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_refdb_fs_h__
#define INCLUDE_refdb_fs_h__
+#include "strmap.h"
+
typedef struct {
git_strmap *packfile;
time_t packfile_time;
diff --git a/src/util.h b/src/util.h
index 1ff5080..8bba368 100644
--- a/src/util.h
+++ b/src/util.h
@@ -9,6 +9,7 @@
#include "git2/buffer.h"
#include "buffer.h"
+#include "thread-utils.h"
#include "common.h"
#include "strnlen.h"
@@ -286,8 +287,6 @@ extern int git__strncasecmp(const char *a, const char *b, size_t sz);
extern int git__strcasesort_cmp(const char *a, const char *b);
-#include "thread-utils.h"
-
typedef struct {
git_atomic refcount;
void *owner;