Get rid of GIT__PRIVATE macro Using it in the first place means something's wrong. This patch replaces it with an internal header which carries the previously "protected" code instead. Internal source-files simply include "commit.h" and they're done. The internal header includes the public one to make sure we always use the proper prototype. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
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
diff --git a/Makefile b/Makefile
index b32af57..1f3ae5e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,6 @@ CFLAGS = -g -O2 -Wall
OS = unix
BASIC_CFLAGS := -Isrc
-BASIC_CFLAGS += -DGIT__PRIVATE
BASIC_CFLAGS += -fvisibility=hidden
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c))
diff --git a/src/commit.c b/src/commit.c
index 7c98210..ce02d0e 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -23,7 +23,7 @@
* Boston, MA 02110-1301, USA.
*/
-#include "git/commit.h"
+#include "commit.h"
const git_oid *git_commit_id(git_commit *c)
{
diff --git a/src/commit.h b/src/commit.h
new file mode 100644
index 0000000..c863948
--- /dev/null
+++ b/src/commit.h
@@ -0,0 +1,14 @@
+#ifndef INCLUDE_commit_h__
+#define INCLUDE_commit_h__
+#include "git/commit.h"
+
+#include <time.h>
+
+struct git_commit {
+ git_oid id;
+ time_t commit_time;
+ unsigned parsed:1,
+ flags:26;
+};
+
+#endif
diff --git a/src/git/commit.h b/src/git/commit.h
index 8cb3e7d..a4e23d6 100644
--- a/src/git/commit.h
+++ b/src/git/commit.h
@@ -40,14 +40,6 @@ GIT_BEGIN_DECL
/** Parsed representation of a commit object. */
typedef struct git_commit git_commit;
-#ifdef GIT__PRIVATE
-struct git_commit {
- git_oid id;
- time_t commit_time;
- unsigned parsed:1,
- flags:26;
-};
-#endif
/**
* Parse (or lookup) a commit from a revision pool.