From 4f0adcd0e61eabe06fe32be66b16559537124b7a Mon Sep 17 00:00:00 2001 From: Andreas Ericsson Date: Tue, 18 Nov 2008 21:28:55 +0100 Subject: [PATCH] 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 Signed-off-by: Shawn O. Pearce --- Makefile | 1 - src/commit.c | 2 +- src/commit.h | 14 ++++++++++++++ src/git/commit.h | 8 -------- 4 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 src/commit.h diff --git a/Makefile b/Makefile index b32af570d..1f3ae5e22 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 7c982100f..ce02d0ef9 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 000000000..c863948af --- /dev/null +++ b/src/commit.h @@ -0,0 +1,14 @@ +#ifndef INCLUDE_commit_h__ +#define INCLUDE_commit_h__ +#include "git/commit.h" + +#include + +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 8cb3e7d4c..a4e23d6af 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.