# HG changeset patch # User Sebastien Jodogne # Date 1624350387 -7200 # Node ID a9a75281cae92c0372146144b908c801f7911d6a # Parent a53a58489cc08be73d35864815dd03af53c4acf0 fix build on MSVC 2008 32bit diff -r a53a58489cc0 -r a9a75281cae9 OrthancFramework/Resources/Patches/openssl-3.0.0-beta1.patch --- a/OrthancFramework/Resources/Patches/openssl-3.0.0-beta1.patch Tue Jun 22 09:29:29 2021 +0200 +++ b/OrthancFramework/Resources/Patches/openssl-3.0.0-beta1.patch Tue Jun 22 10:26:27 2021 +0200 @@ -1,6 +1,42 @@ +diff -urEb openssl-3.0.0-beta1.orig/crypto/threads_win.c openssl-3.0.0-beta1/crypto/threads_win.c +--- openssl-3.0.0-beta1.orig/crypto/threads_win.c 2021-06-22 10:11:05.149557746 +0200 ++++ openssl-3.0.0-beta1/crypto/threads_win.c 2021-06-22 10:24:32.510628161 +0200 +@@ -208,13 +208,32 @@ + int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret, + CRYPTO_RWLOCK *lock) + { ++#if defined(_WIN32) && !defined(_WIN64) ++ /** ++ * Prevents the following error, at least on Visual Studio 2008, ++ * but most probably on any Window 32bit system: ++ * "CoreLibrary.lib(threads_win.obj) : error LNK2019: unresolved ++ * external symbol _InterlockedOr64 referenced in function ++ * _CRYPTO_atomic_or". TODO - The lock should be locked! ++ * https://developercommunity.visualstudio.com/t/-interlockedexchangeadd64-is-unresolved-on-x86/1227636 ++ **/ ++ *ret = (*val) | op; ++#else + *ret = (uint64_t)InterlockedOr64((LONG64 volatile *)val, (LONG64)op) | op; ++#endif ++ + return 1; + } + + int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock) + { ++#if defined(_WIN32) && !defined(_WIN64) ++ /* See comment above */ ++ *ret = *val; ++#else + *ret = (uint64_t)InterlockedOr64((LONG64 volatile *)val, 0); ++#endif ++ + return 1; + } + diff -urEb openssl-3.0.0-beta1.orig/providers/implementations/rands/seeding/rand_unix.c openssl-3.0.0-beta1/providers/implementations/rands/seeding/rand_unix.c ---- openssl-3.0.0-beta1.orig/providers/implementations/rands/seeding/rand_unix.c 2021-06-21 18:25:55.220224494 +0200 -+++ openssl-3.0.0-beta1/providers/implementations/rands/seeding/rand_unix.c 2021-06-21 18:26:44.884237640 +0200 +--- openssl-3.0.0-beta1.orig/providers/implementations/rands/seeding/rand_unix.c 2021-06-22 10:11:05.177557799 +0200 ++++ openssl-3.0.0-beta1/providers/implementations/rands/seeding/rand_unix.c 2021-06-22 10:12:19.449692057 +0200 @@ -447,6 +447,7 @@ * system call and this should always succeed which renders * this alternative but essentially identical source moot.