Commit 738715eb4c12357b150e04ca1fd174f90bf22b9d

Vicent Martí 2011-07-25T12:02:20

Merge pull request #337 from belkiss/development Modify struct definition to enable forward declare with C++ compiler, thus avoid including C library's header in C++ header.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 96f8649..8a0f134 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -48,10 +48,11 @@ GIT_BEGIN_DECL
 #define GIT_OID_MINPREFIXLEN 4
 
 /** Unique identity of any object (commit, tree, blob, tag). */
-typedef struct {
+typedef struct _git_oid git_oid;
+struct _git_oid {
 	/** raw binary formatted id */
 	unsigned char id[GIT_OID_RAWSZ];
-} git_oid;
+};
 
 /**
  * Parse a hex formatted object id into a git_oid.