]> granicus.if.org Git - libexpat/commitdiff
xmlparse.c: Limit declaration of rand_s to mingwrt <5.3.0 rand-s-mingwrt-version-guard
authorSebastian Pipping <sebastian@pipping.org>
Fri, 11 Oct 2019 22:02:07 +0000 (00:02 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Sun, 13 Oct 2019 11:06:05 +0000 (13:06 +0200)
expat/lib/xmlparse.c

index bb56e59a164ce54dbb23250913a01fd2f18d4ee5..d8e1f3deba0e887fb35377f1a78a2de447c0fe7b 100644 (file)
@@ -737,9 +737,11 @@ writeRandomBytes_arc4random(void *target, size_t count) {
 #ifdef _WIN32
 
 /* Provide declaration of rand_s() for MinGW-32 (not 64, which has it),
-   as it doesn't declare it in its header up to at least 5.2.2 version
-   of its runtime package (mingwrt, containing stdlib.h). */
-#  if defined(__MINGW32__) && ! defined(__MINGW64_VERSION_MAJOR)
+   as it didn't declare it in its header prior to version 5.3.0 of its
+   runtime package (mingwrt, containing stdlib.h).  The upstream fix
+   was introduced at https://osdn.net/projects/mingw/ticket/39658 . */
+#  if defined(__MINGW32__) && defined(__MINGW32_VERSION)                       \
+      && __MINGW32_VERSION < 5003000L && ! defined(__MINGW64_VERSION_MAJOR)
 __declspec(dllimport) int rand_s(unsigned int *);
 #  endif