From b8f6c2b388032af569083f120c344bb589849510 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 28 Aug 2008 16:55:37 +0000 Subject: [PATCH] Use binary mode for output file on Windows. 2008-08-28 Tor Lillqvist * tools/compiler.c (write_out_typelib): Use binary mode for output file on Windows. * girepository/girnode.c: Don't print NULL strings. * tests/invoke/Makefile.am * tests/scanner/Makefile.am: Use -no-undefined on Windows to convince libtool to build shared libraries. * tests/invoke/invoke.c: Don't needlessly include . Use g_assert() instead of printing out expected errors. svn path=/trunk/; revision=509 --- girepository/tools/compiler.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/girepository/tools/compiler.c b/girepository/tools/compiler.c index a3f5e7235..b7112f22d 100644 --- a/girepository/tools/compiler.c +++ b/girepository/tools/compiler.c @@ -24,6 +24,11 @@ #include #include +#ifdef G_OS_WIN32 +#include +#include +#endif + #include "girmodule.h" #include "girnode.h" #include "girparser.h" @@ -96,7 +101,12 @@ write_out_typelib (gchar *prefix, FILE *file; if (output == NULL) - file = stdout; + { + file = stdout; +#ifdef G_OS_WIN32 + setmode (fileno (file), _O_BINARY); +#endif + } else { gchar *filename; @@ -105,7 +115,7 @@ write_out_typelib (gchar *prefix, filename = g_strdup_printf ("%s-%s", prefix, output); else filename = g_strdup (output); - file = g_fopen (filename, "w"); + file = g_fopen (filename, "wb"); if (file == NULL) {