mdbx-windows: fix for non-x86 with MDBX_WITHOUT_MSVC_CRT=ON and MDBX_BUILD_SHARED_LIBRARY=ON.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2022-04-22 18:31:49 +03:00
parent 03e7e3be74
commit f341129afa
2 changed files with 5 additions and 0 deletions

View File

@ -1945,6 +1945,9 @@ __cold MDBX_INTERNAL_FUNC void mdbx_osal_jitter(bool tiny) {
#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \
defined(__x86_64__)
const unsigned salt = 277u * (unsigned)__rdtsc();
#elif (defined(_WIN32) || defined(_WIN64)) && MDBX_WITHOUT_MSVC_CRT
static ULONG state;
const unsigned salt = (unsigned)RtlRandomEx(&state);
#else
const unsigned salt = rand();
#endif

View File

@ -991,6 +991,8 @@ typedef LSTATUS(WINAPI *MDBX_RegGetValueA)(HKEY hkey, LPCSTR lpSubKey,
LPDWORD pcbData);
MDBX_INTERNAL_VAR MDBX_RegGetValueA mdbx_RegGetValueA;
NTSYSAPI ULONG RtlRandomEx(PULONG Seed);
#endif /* Windows */
#endif /* !__cplusplus */