Not to worry. A non-gtk #define was redefining the string return_value, 
annoyingly.


----- Original Message ----


Hi All,

I'm having a little trouble figuring out what is going on when I'm trying to 
build a test app with glib.
The problem is this - the first error I get when compiling (gcc 4.1.3, glib 
2.14.5) is

In file included from /usr/local/include/glib-2.0/gobject/gobject.h:30,
                 from /usr/local/include/glib-2.0/glib-object.h:28,
                 from /usr/include/pango-1.0/pango/pango-types.h:27,
                 from /usr/include/pango-1.0/pango/pango-font.h:27,
                 from /usr/include/pango-1.0/pango/pango-attributes.h:26,
                 from /usr/include/pango-1.0/pango/pango.h:26,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:34,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcairo.h:24,
                 from /usr/include/gtk-2.0/gdk/gdk.h:31,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from main_gtk.c:55:
/usr/local/include/glib-2.0/gobject/gclosure.h:46: error: expected ‘;’, ‘,’ or 
‘)’ before ‘return’

I get similar errors in the same file and examination of the above location 
shows the following definition:

typedef void  (*GClosureMarshal)  (GClosure *closure,
           GValue         *return_value,
           guint           n_param_values,
           const GValue   *param_values,
           gpointer        invocation_hint,
           gpointer  marshal_data);

which doesn't look too bad. However, if I look at the preprocessor output (-E) 
the definition changes to 

typedef void (*GClosureMarshal) (GClosure *closure,
      GValue *return,
      guint n_param_values,
      const GValue *param_values,
      gpointer invocation_hint,
      gpointer marshal_data);

and I suppose that using a keyword "return" is not supported by gcc (anymore? I 
haven't tried this with an earlier gcc). I can manually change the argument 
(this occurs more than once, btw) so it isn't using a reserved word in the .i 
file and build from there, but it doesn't seem to be very elegant! 
I've only just found this so haven't had the time to figure out if there is 
more information in the .i file I'm missing. If it is any use, here is the .i 
file a little above the GClosureMarshal definition:

# 233 "/usr/local/include/glib-2.0/gobject/gparam.h"

# 29 "/usr/local/include/glib-2.0/gobject/gobject.h" 2
# 1 "/usr/local/include/glib-2.0/gobject/gclosure.h" 1
# 27 "/usr/local/include/glib-2.0/gobject/gclosure.h"
# 1 "/usr/local/include/glib-2.0/gobject/gtype.h" 1
# 28 "/usr/local/include/glib-2.0/gobject/gclosure.h" 2


# 40 "/usr/local/include/glib-2.0/gobject/gclosure.h"
typedef struct _GClosure GClosure;
typedef struct _GClosureNotifyData GClosureNotifyData;
typedef void (*GCallback) (void);
typedef void (*GClosureNotify) (gpointer data,
      GClosure *closure);
typedef void (*GClosureMarshal) (GClosure *closure,
      GValue *return,
      guint n_param_values,
      const GValue *param_values,
      gpointer invocation_hint,
      gpointer marshal_data);

I can't see how this is happening, can anyone offer a solution/ explanation? 

Regards, 

Mike



_______________________________________________
gtk-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-list





      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Inbox http://uk.docs.yahoo.com/nowyoucan.html
_______________________________________________
gtk-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to