Commit e5aecaf6 by Edward Thomson

sha1: don't inline `git_hash_global_init` for win32

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.
parent 9aa049d4
...@@ -109,6 +109,21 @@ static void git_hash_global_shutdown(void) ...@@ -109,6 +109,21 @@ static void git_hash_global_shutdown(void)
hash_cryptoapi_prov_shutdown(); 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 */ /* CryptoAPI: available in Windows XP and newer */
GIT_INLINE(int) hash_ctx_cryptoapi_init(git_hash_ctx *ctx) GIT_INLINE(int) hash_ctx_cryptoapi_init(git_hash_ctx *ctx)
......
...@@ -138,19 +138,6 @@ struct git_hash_ctx { ...@@ -138,19 +138,6 @@ struct git_hash_ctx {
} ctx; } ctx;
}; };
GIT_INLINE(int) git_hash_global_init(void) extern 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 #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment