Commit bbf034ab931cd6346420066cbb00cf16ae893510

Patrick Steinhardt 2019-02-22T13:43:16

hash: move `git_hash_prov` into Win32 backend The structure `git_hash_prov` is only ever used by the Win32 SHA1 backend. As such, it doesn't make much sense to expose it via the generic "hash.h" header, as it is an implementation detail of the Win32 backend only. Move the typedef of `git_hash_prov` into "hash/sha1/win32.h" to fix this.

diff --git a/src/hash.h b/src/hash.h
index bd3e3b5..0d2e7e4 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -11,7 +11,6 @@
 
 #include "git2/oid.h"
 
-typedef struct git_hash_prov git_hash_prov;
 typedef struct git_hash_ctx git_hash_ctx;
 
 int git_hash_ctx_init(git_hash_ctx *ctx);
diff --git a/src/hash/hash_win32.h b/src/hash/hash_win32.h
index ca448c2..b9a85f8 100644
--- a/src/hash/hash_win32.h
+++ b/src/hash/hash_win32.h
@@ -106,14 +106,14 @@ struct hash_cng_prov {
 	DWORD hash_object_size;
 };
 
-struct git_hash_prov {
+typedef struct {
 	enum hash_win32_prov_type type;
 
 	union {
 		struct hash_cryptoapi_prov cryptoapi;
 		struct hash_cng_prov cng;
 	} prov;
-};
+} git_hash_prov;
 
 /* Hash contexts */