binary mode for any2ppm pipe

LRN <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attached are patches that make any2ppm pipe use binary mode.
This solves a lot of testsuite problems on W32.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRXLkiAAoJEOs4Jb6SI2CwE6cIAJfzS+Hf7CdEqXEbD2gAJYBX
LPmBQ7UPaMgBuGDECV2zRhrtLm5hhQLy+Xp7zH4ip9YxrfsHZ07oSIrCpPVugGzG
nYKEeIQR3kp8iAGMvq1JSoWhfVM4VdV3HUr2ZmzAQYb86kc1deMV7rrQWFKMkmd/
IlFIRkp2B1dkveh5ChHpXkTymQtQp66dV0Wya/aNxasOF/SSmpWM/Y+R4wBkUBUB
ZK5EwdhkqRG75x6QxhBMjR6G6atTSDrq8iSfj4ZA8Tbk3iyn8Xxuia+GeRlErBAp
Dfj/Batmkgnc/tNYFUjFcHNtExX6lMF4/daBaMWFc58MQKWDsvRAwZK5vx1GwpQ=
=4swC
-----END PGP SIGNATURE-----

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
0010-binary-mode-in-any2ppm.mingw32.patch (text/plain, 731 B)
--- cairo-1.12.14/test/any2ppm.c.orig	2013-04-03 18:21:16 +0400
+++ cairo-1.12.14/test/any2ppm.c	2013-04-03 19:02:05 +0400
@@ -79,8 +79,11 @@
 
 #include <errno.h>
 
-#if HAVE_UNISTD_H && HAVE_FCNTL_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && HAVE_SYS_POLL_H && HAVE_SYS_UN_H
+#if HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
+
+#if HAVE_UNISTD_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && HAVE_SYS_POLL_H && HAVE_SYS_UN_H
 #include <signal.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
@@ -869,6 +872,10 @@
     rsvg_set_default_dpi (72.0);
 #endif
 
+#if defined(_WIN32) && !defined (__CYGWIN__)
+    _setmode (1, _O_BINARY);
+#endif
+
     if (argc == 1)
 	err = any2ppm_daemon ();
     else
0012-more-binary-mode.mingw32.patch (text/plain, 360 B)
--- cairo-1.12.14/boilerplate/cairo-boilerplate.c.orig	2013-04-04 01:06:12 +0400
+++ cairo-1.12.14/boilerplate/cairo-boilerplate.c	2013-04-04 02:03:47 +0400
@@ -837,7 +837,7 @@
 
     *close_cb = pclose;
     sprintf (command, "%s %s %d", any2ppm, filename, page);
-    return popen (command, "r");
+    return popen (command, "rb");
 }
 
 static cairo_bool_t
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.