From: John Darrington Date: Tue, 20 Nov 2012 11:32:34 +0000 (+0100) Subject: Fix (again) problems displaying a GtkSourceView widget on Cygwin X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab6a775adf51dff998699ed87904d9436e65ce9a;hp=00fd47eccf62f5657bc32655bdddcf3758d882e2;p=pspp Fix (again) problems displaying a GtkSourceView widget on Cygwin 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. --- diff --git a/src/ui/gui/widgets.c b/src/ui/gui/widgets.c index f6dbede80f..5cff7e9265 100644 --- a/src/ui/gui/widgets.c +++ b/src/ui/gui/widgets.c @@ -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 (); }