From: bungeman Date: Wed, 18 Sep 2019 14:39:05 +0000 (-0400) Subject: Only define _CRT_RAND_S when not already defined. X-Git-Tag: R_2_2_9~5^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6de942020d46e50efcc4b73dbe70d9c3292743a;p=libexpat 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. --- 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