From ab6a775adf51dff998699ed87904d9436e65ce9a Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 20 Nov 2012 12:32:34 +0100 Subject: [PATCH] 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. --- src/ui/gui/widgets.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 (); } -- 2.30.2