From ac7883b8d59fbd3e819c3a194862f58cb0a65ea0 Mon Sep 17 00:00:00 2001 From: Jonah Beckford <71855677+jonahbeckford@users.noreply.github.com> Date: Thu, 26 Aug 2021 17:22:12 -0700 Subject: [PATCH] MSVC fix for rng/unix/mc_getrandom_stubs --- rng/unix/mc_getrandom_stubs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rng/unix/mc_getrandom_stubs.c b/rng/unix/mc_getrandom_stubs.c index c36a6335..8b80eee8 100644 --- a/rng/unix/mc_getrandom_stubs.c +++ b/rng/unix/mc_getrandom_stubs.c @@ -1,4 +1,6 @@ -#include +#ifndef _MSC_VER +# include +#endif #include #include @@ -41,7 +43,7 @@ void raw_getrandom (uint8_t *data, uint32_t len) { if (getentropy(data + i, rlen) < 0) uerror("getentropy", Nothing); } } -#elif (defined(__WIN32__)) +#elif (defined(__WIN32__) || defined(_WIN32)) /* There is a choice between using RtlGenRandom and BCryptGenRandom * here, and Microsoft does not make the choice obvious. It appears * that RtlGenRandom is best used when older Windows compatibility