]> git.proxmox.com Git - libgit2.git/commitdiff
Get rid of GIT__PRIVATE macro
authorAndreas Ericsson <ae@op5.se>
Tue, 18 Nov 2008 20:28:55 +0000 (21:28 +0100)
committerShawn O. Pearce <spearce@spearce.org>
Sat, 22 Nov 2008 20:08:00 +0000 (12:08 -0800)
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>
Makefile
src/commit.c
src/commit.h [new file with mode: 0644]
src/git/commit.h

index b32af570d6088f5ec58b08d0f7ad3a74265667f4..1f3ae5e22cbbd99f678fddf3eb1a86726cbca831 100644 (file)
--- 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))
index 7c982100f3c7b81e576b552484d58470631f2cbe..ce02d0ef9ea8dc621df41d3f244858bd60f41d48 100644 (file)
@@ -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 (file)
index 0000000..c863948
--- /dev/null
@@ -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
index 8cb3e7d4c2c5ae36a7ec398299007af302bab6a3..a4e23d6af621573f5e01adeae0c34099f66df32f 100644 (file)
@@ -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.