Skip to content

Commit c4cd69b

Browse files
authored
Merge pull request libgit2#5039 from libgit2/ethomson/win32_hash
sha1: don't inline `git_hash_global_init` for win32
2 parents 5a190ad + e5aecaf commit c4cd69b

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/hash/hash_win32.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,21 @@ static void git_hash_global_shutdown(void)
109109
hash_cryptoapi_prov_shutdown();
110110
}
111111

112+
int git_hash_global_init(void)
113+
{
114+
int error = 0;
115+
116+
if (hash_prov.type != INVALID)
117+
return 0;
118+
119+
if ((error = hash_cng_prov_init()) < 0)
120+
error = hash_cryptoapi_prov_init();
121+
122+
git__on_shutdown(git_hash_global_shutdown);
123+
124+
return error;
125+
}
126+
112127
/* CryptoAPI: available in Windows XP and newer */
113128

114129
GIT_INLINE(int) hash_ctx_cryptoapi_init(git_hash_ctx *ctx)

src/hash/hash_win32.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,6 @@ struct git_hash_ctx {
138138
} ctx;
139139
};
140140

141-
GIT_INLINE(int) git_hash_global_init(void)
142-
{
143-
int error = 0;
144-
145-
if (hash_prov.type != INVALID)
146-
return 0;
147-
148-
if ((error = hash_cng_prov_init()) < 0)
149-
error = hash_cryptoapi_prov_init();
150-
151-
git__on_shutdown(git_hash_global_shutdown);
152-
153-
return error;
154-
}
141+
extern int git_hash_global_init(void);
155142

156143
#endif

0 commit comments

Comments
 (0)