gtype.h broken for 64-bit



Hi,

On 64-bit, sizeof(GType) is 8 but sizeof(GTypeFundamentals) is
4. So in this code in gobject.c:

    g_signal_new ("notify",
                  G_TYPE_FROM_CLASS (class),
                  G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE |
                  G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS,
                  G_STRUCT_OFFSET (GObjectClass, notify),
                  NULL, NULL,
                  g_cclosure_marshal_VOID__PARAM,
                  G_TYPE_NONE,
                  1, G_TYPE_PARAM);

G_TYPE_PARAM goes through the varargs as 4 bytes, then we collect it
as 8 bytes, and everything blows up.

One possible patch is to change the enum to a bunch of macros as
follows:

 #define G_TYPE_CHAR ((GType) 3 << G_TYPE_FUNDAMENTAL_SHIFT)

That patch makes testgruntime work for me again on ia64. There is a
tiny API change here, which is that you no longer need the enum name
GTypeFundamentals, but I doubt anyone is using it - GLib itself
doesn't appear to.

This is showstopper-ish, so please let me know how to fix as soon as
you can.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]