From: Soujyu Tanaka Date: Wed, 27 Mar 2019 07:15:31 +0000 (+0900) Subject: Avoid linking error for InitializeCriticalSectionAndSpinCount(). X-Git-Tag: OpenSSL_1_1_1c~73 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=916704b3c6256955e6df5141437a1a809d3539d8;p=oweals%2Fopenssl.git Avoid linking error for InitializeCriticalSectionAndSpinCount(). Replace it with InitializeCriticalSection() Reviewed-by: Richard Levitte Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8596) (cherry picked from commit 09305a7d0afcf9ae2d5be459ad6e6433ea85f913) --- diff --git a/crypto/threads_win.c b/crypto/threads_win.c index d8fdfb74f5..5f44259509 100644 --- a/crypto/threads_win.c +++ b/crypto/threads_win.c @@ -24,11 +24,15 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void) return NULL; } +#if !defined(_WIN32_WCE) /* 0x400 is the spin count value suggested in the documentation */ if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) { OPENSSL_free(lock); return NULL; } +#else + InitializeCriticalSection(lock); +#endif return lock; }