mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 01:36:17 +01:00
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:
parent
6f791d89cf
commit
b8f6c2b388
@ -24,6 +24,11 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
#include <io.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "girmodule.h"
|
#include "girmodule.h"
|
||||||
#include "girnode.h"
|
#include "girnode.h"
|
||||||
#include "girparser.h"
|
#include "girparser.h"
|
||||||
@ -96,7 +101,12 @@ write_out_typelib (gchar *prefix,
|
|||||||
FILE *file;
|
FILE *file;
|
||||||
|
|
||||||
if (output == NULL)
|
if (output == NULL)
|
||||||
|
{
|
||||||
file = stdout;
|
file = stdout;
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
setmode (fileno (file), _O_BINARY);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gchar *filename;
|
gchar *filename;
|
||||||
@ -105,7 +115,7 @@ write_out_typelib (gchar *prefix,
|
|||||||
filename = g_strdup_printf ("%s-%s", prefix, output);
|
filename = g_strdup_printf ("%s-%s", prefix, output);
|
||||||
else
|
else
|
||||||
filename = g_strdup (output);
|
filename = g_strdup (output);
|
||||||
file = g_fopen (filename, "w");
|
file = g_fopen (filename, "wb");
|
||||||
|
|
||||||
if (file == NULL)
|
if (file == NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user