Skip to content

Commit

Permalink
MSVC fix for rng/unix/mc_getrandom_stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahbeckford committed Aug 27, 2021
1 parent 72eaf04 commit ac7883b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rng/unix/mc_getrandom_stubs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <unistd.h>
#ifndef _MSC_VER
# include <unistd.h>
#endif

#include <caml/mlvalues.h>
#include <caml/memory.h>
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ac7883b

Please sign in to comment.