Skip to content

Commit 896e647

Browse files
pks-tgitster
authored andcommitted
reftable: introduce "reftable-system.h" header
We're including a couple of standard headers like <stdint.h> in a bunch of locations, which makes it hard for a project to plug in their own logic for making required functionality available. For us this is for example via "compat/posix.h", which already includes all of the system headers relevant to us. Introduce a new "reftable-system.h" header that allows projects to provide their own headers. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent bdbd4dc commit 896e647

13 files changed

Lines changed: 20 additions & 10 deletions

reftable/reftable-basics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef REFTABLE_BASICS_H
1010
#define REFTABLE_BASICS_H
1111

12-
#include <stddef.h>
12+
#include "reftable-system.h"
1313

1414
/* A buffer that contains arbitrary byte slices. */
1515
struct reftable_buf {

reftable/reftable-block.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
#ifndef REFTABLE_BLOCK_H
1010
#define REFTABLE_BLOCK_H
1111

12-
#include <stdint.h>
13-
12+
#include "reftable-system.h"
1413
#include "reftable-basics.h"
1514
#include "reftable-blocksource.h"
1615
#include "reftable-iterator.h"

reftable/reftable-blocksource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef REFTABLE_BLOCKSOURCE_H
1010
#define REFTABLE_BLOCKSOURCE_H
1111

12-
#include <stdint.h>
12+
#include "reftable-system.h"
1313

1414
/*
1515
* Generic wrapper for a seekable readable file.

reftable/reftable-error.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef REFTABLE_ERROR_H
1010
#define REFTABLE_ERROR_H
1111

12+
#include "reftable-system.h"
13+
1214
/*
1315
* Errors in reftable calls are signaled with negative integer return values. 0
1416
* means success.

reftable/reftable-fsck.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef REFTABLE_FSCK_H
22
#define REFTABLE_FSCK_H
33

4+
#include "reftable-system.h"
45
#include "reftable-stack.h"
56

67
enum reftable_fsck_error {

reftable/reftable-iterator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef REFTABLE_ITERATOR_H
1010
#define REFTABLE_ITERATOR_H
1111

12+
#include "reftable-system.h"
1213
#include "reftable-record.h"
1314

1415
struct reftable_iterator_vtable;

reftable/reftable-merged.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef REFTABLE_MERGED_H
1010
#define REFTABLE_MERGED_H
1111

12+
#include "reftable-system.h"
1213
#include "reftable-iterator.h"
1314

1415
/*

reftable/reftable-record.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef REFTABLE_RECORD_H
1010
#define REFTABLE_RECORD_H
1111

12+
#include "reftable-system.h"
1213
#include "reftable-basics.h"
13-
#include <stdint.h>
1414

1515
/*
1616
* Basic data types

reftable/reftable-stack.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef REFTABLE_STACK_H
1010
#define REFTABLE_STACK_H
1111

12+
#include "reftable-system.h"
1213
#include "reftable-writer.h"
1314

1415
/*

reftable/reftable-system.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifndef REFTABLE_SYSTEM_H
2+
#define REFTABLE_SYSTEM_H
3+
4+
#define MINGW_DONT_HANDLE_IN_USE_ERROR
5+
#include "compat/posix.h"
6+
7+
#endif

0 commit comments

Comments
 (0)