From c6de942020d46e50efcc4b73dbe70d9c3292743a Mon Sep 17 00:00:00 2001 From: bungeman Date: Wed, 18 Sep 2019 10:39:05 -0400 Subject: [PATCH] Only define _CRT_RAND_S when not already defined. There exist builds which go out of their way to define _CRT_RAND_S for everything by forcing it into the list of macros defined on the command line to the compiler. Unfortunately, something like "-D_CRT_RAND_S" implies _CRT_RAND_S is defined to be '1' and defining it to be empty produces a redefinition. Since the intention here is to ensure that _CRT_RAND_S is always defined, only define it if it isn't already defined. --- expat/lib/xmlparse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index e740f0e1..08a04c65 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -36,7 +36,9 @@ #ifdef _WIN32 /* force stdlib to define rand_s() */ -# define _CRT_RAND_S +# if ! defined(_CRT_RAND_S) +# define _CRT_RAND_S +# endif #endif #include -- 2.40.0