From b8df6b5003fad43a9312647077b89d06f709e1a0 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Wed, 30 Sep 2020 11:52:00 +0200 Subject: [PATCH] Try to fix the Windows build. --- usrsctplib/user_environment.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usrsctplib/user_environment.c b/usrsctplib/user_environment.c index b06fc678d..2bf44520a 100755 --- a/usrsctplib/user_environment.c +++ b/usrsctplib/user_environment.c @@ -30,7 +30,11 @@ /* __Userspace__ */ -#if !defined(_WIN32) +#if defined(_WIN32) +#if !defined(_CRT_RAND_S) && !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) +#define _CRT_RAND_S +#endif +#else #include #include #endif @@ -62,7 +66,7 @@ userland_mutex_t atomic_mtx; * provide _some_ kind of randomness. This should only be used * inside other RNG's, like arc4random(9). */ -#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) #include void @@ -105,9 +109,6 @@ finish_random(void) return; } #elif defined(_WIN32) -#if !defined(_CRT_RAND_S) -#define _CRT_RAND_S -#endif #include void