[gs-commits] mupdf 1.16.1.epub-prerelease-33 Hack to make Curl work wi

[email protected] (Robin Watts) Thu, 2 Jan 2020 11:19:12 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit 66dc323855e192743d4ce9ac1c58c2a59a1260dd
Author: Robin Watts <[email protected]>
Date:   Wed Jan 1 17:55:53 2020 +0000

    Hack to make Curl work with VS2019.
    
    Possibly we can avoid this by updating curl. For now, this'll do.

diff --git a/platform/x11/curl_stream.c b/platform/x11/curl_stream.c
index b7a612e..10ffa35 100644
--- a/platform/x11/curl_stream.c
+++ b/platform/x11/curl_stream.c
@@ -13,6 +13,24 @@
 #include <pthread.h>
 #endif
 
+#ifdef _WIN32
+#if _MSC_VER >= 1910
+/* Horrible hack to make this work with VS2017 and higher. */
+static FILE _iob[3];
+static int got_iob = 0;
+FILE * __cdecl __iob_func(void)
+{
+	if (!got_iob) {
+		_iob[0] = *stdin;
+		_iob[1] = *stdout;
+		_iob[2] = *stderr;
+		got_iob = 1;
+	}
+	return _iob;
+}
+#endif
+#endif
+
 #undef DEBUG_BLOCK_FETCHING
 
 #ifdef DEBUG_BLOCK_FETCHING

http://git.ghostscript.com/?p=mupdf.git;a=commit;h=66dc323855e192743d4ce9ac1c58c2a59a1260dd

--
MuPDF library
Artifex Software, Inc.