Fix (again) problems displaying a GtkSourceView widget on Cygwin
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 20 Nov 2012 11:32:34 +0000 (12:32 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 20 Nov 2012 11:32:34 +0000 (12:32 +0100)
Under certain compiler options, the effect of the gtk_*get_type
function call was optimised away.  This change fixes that.  It
seems that both static and volatile are necessary, in order to
avoid the compiler from complaining and/or optimising the call
away.

src/ui/gui/widgets.c

index f6dbede80fe31454a3fe80e3ec1ac6be9341231b..5cff7e9265d98124c73c75416c7036a7dc51605b 100644 (file)
@@ -31,6 +31,7 @@
 #include "psppire-dialog-action-var-info.h"
 #include "psppire-value-entry.h"
 
+static  volatile GType kludge;
 
 /* Any custom widgets which are to be used in GtkBuilder ui files
    need to be preregistered, otherwise GtkBuilder refuses to 
@@ -66,5 +67,5 @@ preregister_widgets (void)
 
   /* This seems to be necessary on Cygwin.
      It ought not to be necessary.  Having it here can't do any harm. */
-  (void) gtk_source_view_get_type ();
+  kludge = gtk_source_view_get_type ();
 }