Skip to content

Commit 36edfbc

Browse files
committed
use rtlgenrandom by default on windows
1 parent 0be71a2 commit 36edfbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/random.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ If we cannot get good randomness, we fall back to weak randomness based on a tim
167167

168168
#if defined(_WIN32)
169169

170-
#if !defined(MI_USE_RTLGENRANDOM)
171-
// We prefer BCryptGenRandom over RtlGenRandom
170+
#if defined(MI_USE_BCRYPTGENRANDOM)
171+
// We would like to use BCryptGenRandom instead of RtlGenRandom but it can lead to a deadlock
172+
// under the VS debugger when using dynamic overriding.
172173
#pragma comment (lib,"bcrypt.lib")
173174
#include <bcrypt.h>
174175
static bool os_random_buf(void* buf, size_t buf_len) {

0 commit comments

Comments
 (0)