Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Looks like we do need to set the default fmode on windows for now. I …

…have added it as a cabal flag that can be disabled if it is causing problems with ghci.
  • Loading branch information...
commit 490fb040bf4551e819c4ead3538b5cafb47ef243 1 parent 14bee59
@hamishmack hamishmack authored
View
7 gtk/Graphics/UI/Gtk/General/hsgthread.cpp
@@ -59,9 +59,10 @@ gboolean gtk2hs_run_finalizers(gpointer data);
/* Initialize the default _fmode on WIN32. */
void gtk2hs_initialise (void) {
-#if defined( WIN32 )
- /* Temorary remove this to make gtk work on windows in ghci */
- /* _fmode = _O_BINARY; */
+#if defined( WIN32 ) && defined( GTK2HS_SET_FMODE_BINARY )
+ /* Some Windows GTK binraries (current Fedora MinGW ones) do */
+ /* not open files in binary mode. This is a work around. */
+ _fmode = _O_BINARY;
#endif
}
View
12 gtk/gtk.cabal-renamed
@@ -1,5 +1,5 @@
Name: gtk
-Version: 0.12.5.1
+Version: 0.12.5.2
License: LGPL-2.1
License-file: COPYING
Copyright: (c) 2001-2010 The Gtk2Hs Team
@@ -127,6 +127,13 @@ Flag have-quartz-gtk
Description: Assume that the installed GTK is the version for OS X backend by Quartz, and hence does not provide gdk_x11_drawable_get_xid
Default: False
+Flag fmode-binary
+ Description: Set the default file translation mode for file I/O operations to _O_BINARY.
+ Some GTK libraries open image files without specifing binary mode.
+ If you have trouble loading gtk in ghci, then it may help to turn this
+ option off.
+ Default: True
+
Library
build-depends: base >= 4 && < 5,
array, containers, mtl, bytestring,
@@ -388,4 +395,7 @@ Library
x-Types-Tag: default plugNsocket
cpp-options: -DHAVE_PLUG_AND_SOCKET
+ if os(windows) && flag(fmode-binary)
+ cc-options: -DGTK2HS_SET_FMODE_BINARY
+
pkgconfig-depends: gthread-2.0, gtk+-2.0
View
10 gtk/gtk3.cabal
@@ -126,6 +126,13 @@ Flag build-demos
Description: Build the demo executables
Default: False
+Flag fmode-binary
+ Description: Set the default file translation mode for file I/O operations to _O_BINARY.
+ Some GTK libraries open image files without specifing binary mode.
+ If you have trouble loading gtk in ghci, then it may help to turn this
+ option off.
+ Default: True
+
Library
build-depends: base >= 4 && < 5,
array, containers, mtl, bytestring,
@@ -374,6 +381,9 @@ Library
x-Types-Tag: default plugNsocket
cpp-options: -DHAVE_PLUG_AND_SOCKET
+ if os(windows) && flag(fmode-binary)
+ cc-options: -DGTK2HS_SET_FMODE_BINARY
+
pkgconfig-depends: gthread-2.0, gtk+-3.0
Executable gtk2hs-demo-actionMenu

1 comment on commit 490fb04

@transfuturist

Bless your soul, you finally got it working!

Please sign in to comment.
Something went wrong with that request. Please try again.