Add setter equivalents to X509_REQ_get0_signature
[openssl.git] / crypto / threads_win.c
index 933fdae562e1cc50658542e01454c42e23668452..4d95cd3fbb35ac399bed75e3ee710a4e23adfad8 100644 (file)
@@ -24,15 +24,15 @@ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
         return NULL;
     }
 
-#if !defined(_WIN32_WCE)
+# if !defined(_WIN32_WCE)
     /* 0x400 is the spin count value suggested in the documentation */
     if (!InitializeCriticalSectionAndSpinCount(lock, 0x400)) {
         OPENSSL_free(lock);
         return NULL;
     }
-#else
+# else
     InitializeCriticalSection(lock);
-#endif
+# endif
 
     return lock;
 }
@@ -155,7 +155,7 @@ int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
 
 int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
 {
-    *ret = InterlockedExchangeAdd(val, amount) + amount;
+    *ret = (int)InterlockedExchangeAdd((long volatile *)val, (long)amount) + amount;
     return 1;
 }