Skip to content

Commit 0fb4b35

Browse files
committed
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 parent 9b0482e commit 0fb4b35

File tree

9 files changed

+19
-3
lines changed

9 files changed

+19
-3
lines changed

src/clone.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef INCLUDE_clone_h__
88
#define INCLUDE_clone_h__
99

10+
#include "git2/clone.h"
11+
1012
extern int git_clone__should_clone_local(const char *url, git_clone_local_t local);
1113

1214
#endif

src/diff_generate.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#ifndef INCLUDE_diff_generate_h__
88
#define INCLUDE_diff_generate_h__
99

10+
#include "diff.h"
11+
#include "pool.h"
12+
#include "index.h"
13+
1014
enum {
1115
GIT_DIFFCAPS_HAS_SYMLINKS = (1 << 0), /* symlinks on platform? */
1216
GIT_DIFFCAPS_IGNORE_STAT = (1 << 1), /* use stat? */

src/diff_tform.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef INCLUDE_diff_tform_h__
88
#define INCLUDE_diff_tform_h__
99

10+
#include "diff_file.h"
11+
1012
extern int git_diff_find_similar__hashsig_for_file(
1113
void **out, const git_diff_file *f, const char *path, void *p);
1214

src/fetch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef INCLUDE_fetch_h__
88
#define INCLUDE_fetch_h__
99

10+
#include "git2/remote.h"
11+
1012
#include "netops.h"
1113

1214
int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts);

src/fetchhead.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef INCLUDE_fetchhead_h__
88
#define INCLUDE_fetchhead_h__
99

10+
#include "oid.h"
1011
#include "vector.h"
1112

1213
typedef struct git_fetchhead_ref {

src/indexer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef INCLUDE_indexer_h__
88
#define INCLUDE_indexer_h__
99

10-
extern int git_indexer__set_fsync(git_indexer *idx, int do_fsync);
10+
#include "git2/indexer.h"
11+
12+
extern void git_indexer__set_fsync(git_indexer *idx, int do_fsync);
1113

1214
#endif

src/patch_parse.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef INCLUDE_patch_parse_h__
88
#define INCLUDE_patch_parse_h__
99

10+
#include "patch.h"
11+
1012
typedef struct {
1113
git_refcount rc;
1214

src/refdb_fs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef INCLUDE_refdb_fs_h__
88
#define INCLUDE_refdb_fs_h__
99

10+
#include "strmap.h"
11+
1012
typedef struct {
1113
git_strmap *packfile;
1214
time_t packfile_time;

src/util.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "git2/buffer.h"
1111
#include "buffer.h"
12+
#include "thread-utils.h"
1213

1314
#include "common.h"
1415
#include "strnlen.h"
@@ -286,8 +287,6 @@ extern int git__strncasecmp(const char *a, const char *b, size_t sz);
286287

287288
extern int git__strcasesort_cmp(const char *a, const char *b);
288289

289-
#include "thread-utils.h"
290-
291290
typedef struct {
292291
git_atomic refcount;
293292
void *owner;

0 commit comments

Comments
 (0)