]> git.ipfire.org Git - thirdparty/openssl.git/commit
threads_win: fix build error with VS2010 x86
authorGeorgi Valkov <gvalkov@gmail.com>
Fri, 28 Jun 2024 05:16:10 +0000 (08:16 +0300)
committerTomas Mraz <tomas@openssl.org>
Mon, 1 Jul 2024 08:02:02 +0000 (10:02 +0200)
commit16beec98d26644b96d57bd8da477166d0bc7d05c
tree3d9dfad89266949b5ee3523c399d7addfa9f0249
parentf96563297ee04d57efd45f56bd6b897d809214b4
threads_win: fix build error with VS2010 x86

InterlockedAnd64 and InterlockedAdd64 are not available on VS2010 x86.
We already have implemented replacements for other functions, such as
InterlockedOr64. Apply the same approach to fix the errors.
A CRYPTO_RWLOCK rw_lock is added to rcu_lock_st.

Replace InterlockedOr64 and InterlockedOr with CRYPTO_atomic_load and
CRYPTO_atomic_load_int, using the existing design pattern.

Add documentation and tests for the new atomic functions
CRYPTO_atomic_add64, CRYPTO_atomic_and

Fixes:
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedAdd64 referenced in function _get_hold_current_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedOr referenced in function _get_hold_current_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedAnd64 referenced in function _update_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedOr64 referenced in function _ossl_synchronize_rcu

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24405)
crypto/threads_none.c
crypto/threads_pthread.c
crypto/threads_win.c
doc/man3/CRYPTO_THREAD_run_once.pod
include/openssl/crypto.h.in
test/threadstest.c
util/libcrypto.num