Avoid linking error for InitializeCriticalSectionAndSpinCount().
authorSoujyu Tanaka <soujyu.tanaka@access-company.com>
Wed, 27 Mar 2019 07:15:31 +0000 (16:15 +0900)
committerMatt Caswell <matt@openssl.org>
Fri, 29 Mar 2019 10:02:06 +0000 (10:02 +0000)
Replace it with InitializeCriticalSection()

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8596)

(cherry picked from commit 09305a7d0afcf9ae2d5be459ad6e6433ea85f913)

crypto/threads_win.c

index d8fdfb74f5b7b093ed3b926eb005c10c4f3df681..5f4425950962dac1c8dc02849c3de161f6f859be 100644 (file)
@@ -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;
 }