diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2019-04-04 18:45:30 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-04-04 18:45:30 +0100 |
commit | e5aecaf62a6a6d88bd082904608952675aec6802 (patch) | |
tree | da18082e372fbd7813cfaee3b4cef82ad9bf2abb /src/hash/hash_win32.c | |
parent | 9aa049d4c1578cfd73ce66801fe2575632296060 (diff) | |
download | libgit2-ethomson/win32_hash.tar.gz |
sha1: don't inline `git_hash_global_init` for win32ethomson/win32_hash
Users of the Win32 hash cannot be inlined, as it uses a static struct.
Don't inline it, but continue to declare the function in the header.
Diffstat (limited to 'src/hash/hash_win32.c')
-rw-r--r-- | src/hash/hash_win32.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/hash/hash_win32.c b/src/hash/hash_win32.c index 792298f39..4b6830358 100644 --- a/src/hash/hash_win32.c +++ b/src/hash/hash_win32.c @@ -109,6 +109,21 @@ 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) |