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
This commit is contained in:
Tor Lillqvist 2008-08-28 16:55:37 +00:00 committed by Evan Welsh
parent 6f791d89cf
commit b8f6c2b388

View File

@ -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)
{