diff options
author | Tor Lillqvist <tml@novell.com> | 2008-08-28 16:55:37 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2008-08-28 16:55:37 +0000 |
commit | 2b24516e72c7bf96afa8f95f8cfad5e4384d58a9 (patch) | |
tree | abb7a29f87a38896a86361fdb640787740b7fd9e /tools/compiler.c | |
parent | af83115e5ca385d1d6964c4b9b7106a4d64c6d5d (diff) | |
download | gobject-introspection-2b24516e72c7bf96afa8f95f8cfad5e4384d58a9.tar.gz |
Use binary mode for output file on Windows.
2008-08-28 Tor Lillqvist <tml@novell.com>
* 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 <dlfcn.h>. Use
g_assert() instead of printing out expected errors.
svn path=/trunk/; revision=509
Diffstat (limited to 'tools/compiler.c')
-rw-r--r-- | tools/compiler.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/compiler.c b/tools/compiler.c index a3f5e723..b7112f22 100644 --- a/tools/compiler.c +++ b/tools/compiler.c @@ -24,6 +24,11 @@ #include <glib.h> #include <glib/gstdio.h> +#ifdef G_OS_WIN32 +#include <io.h> +#include <fcntl.h> +#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) { |