summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-03-22 17:04:32 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2019-03-22 17:04:32 -0700
commitbe9a386ceda92869b8517d55ccf86e9564898bd8 (patch)
tree16aed5e9cb9c44a87eb275d7728a4a6226e7dfc9
parent8e4927a44b29e26afa2cbbd410b7a804e4c182e7 (diff)
downloadlibgit2-be9a386ceda92869b8517d55ccf86e9564898bd8.tar.gz
Each hash implementation should define `git_hash_global_init`
This means the forward declaration isn't necessary. The forward declaration can cause compilation errors as it conflicts with the `GIT_INLINE` declaration (the signatures are different).
-rw-r--r--src/hash.h2
-rw-r--r--src/hash/hash_win32.c15
-rw-r--r--src/hash/hash_win32.h15
3 files changed, 15 insertions, 17 deletions
diff --git a/src/hash.h b/src/hash.h
index 0502e352e..bd3e3b5de 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -31,8 +31,6 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx);
# include "hash/hash_generic.h"
#endif
-int git_hash_global_init(void);
-
typedef struct {
void *data;
size_t len;
diff --git a/src/hash/hash_win32.c b/src/hash/hash_win32.c
index 4b6830358..792298f39 100644
--- a/src/hash/hash_win32.c
+++ b/src/hash/hash_win32.c
@@ -109,21 +109,6 @@ static void git_hash_global_shutdown(void)
hash_cryptoapi_prov_shutdown();
}
-int git_hash_global_init(void)
-{
- int error = 0;
-
- if (hash_prov.type != INVALID)
- return 0;
-
- if ((error = hash_cng_prov_init()) < 0)
- error = hash_cryptoapi_prov_init();
-
- git__on_shutdown(git_hash_global_shutdown);
-
- return error;
-}
-
/* CryptoAPI: available in Windows XP and newer */
GIT_INLINE(int) hash_ctx_cryptoapi_init(git_hash_ctx *ctx)
diff --git a/src/hash/hash_win32.h b/src/hash/hash_win32.h
index 9704204e2..6cddcaa72 100644
--- a/src/hash/hash_win32.h
+++ b/src/hash/hash_win32.h
@@ -138,4 +138,19 @@ struct git_hash_ctx {
} ctx;
};
+GIT_INLINE(int) git_hash_global_init(void)
+{
+ int error = 0;
+
+ if (hash_prov.type != INVALID)
+ return 0;
+
+ if ((error = hash_cng_prov_init()) < 0)
+ error = hash_cryptoapi_prov_init();
+
+ git__on_shutdown(git_hash_global_shutdown);
+
+ return error;
+}
+
#endif