diff --git a/ChangeLog b/ChangeLog index a300268de..b99aa9c5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-26 Mike Kestner + + * glib/Value.cs: make the pad fields a blink explicitly sized struct + instead to avoid alignment issues on x86. [Fixes #469135] + 2009-01-23 Mike Kestner * Makefile.include: diff --git a/glib/Value.cs b/glib/Value.cs index d8954b856..b8968d755 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -30,23 +30,24 @@ namespace GLib { [StructLayout (LayoutKind.Sequential)] public struct Value : IDisposable { + [StructLayout(LayoutKind.Sequential, Size=16)] + struct Padding { + } + IntPtr type; - long pad_1; - long pad_2; + Padding padding; public static Value Empty; public Value (GLib.GType gtype) { type = IntPtr.Zero; - pad_1 = pad_2 = 0; g_value_init (ref this, gtype.Val); } public Value (object obj) { type = IntPtr.Zero; - pad_1 = pad_2 = 0; GType gtype = (GType) obj.GetType (); g_value_init (ref this, gtype.Val); @@ -97,7 +98,6 @@ namespace GLib { public Value (EnumWrapper wrap, string type_name) { type = IntPtr.Zero; - pad_1 = pad_2 = 0; g_value_init (ref this, GType.FromName (type_name).Val); if (wrap.flags) g_value_set_flags (ref this, (uint) (int) wrap); @@ -130,7 +130,6 @@ namespace GLib { public Value (Opaque val, string type_name) { type = IntPtr.Zero; - pad_1 = pad_2 = 0; g_value_init (ref this, GType.FromName (type_name).Val); g_value_set_boxed (ref this, val.Handle); } @@ -148,7 +147,6 @@ namespace GLib { public Value (GLib.Object obj, string prop_name) { type = IntPtr.Zero; - pad_1 = pad_2 = 0; InitForProperty (obj, prop_name); } @@ -156,7 +154,6 @@ namespace GLib { public Value (GLib.Object obj, string prop_name, EnumWrapper wrap) { type = IntPtr.Zero; - pad_1 = pad_2 = 0; InitForProperty (obj.NativeType, prop_name); if (wrap.flags) g_value_set_flags (ref this, (uint) (int) wrap); @@ -168,7 +165,6 @@ namespace GLib { public Value (IntPtr obj, string prop_name, Opaque val) { type = IntPtr.Zero; - pad_1 = pad_2 = 0; InitForProperty (GLib.Object.GetObject (obj), prop_name); g_value_set_boxed (ref this, val.Handle); }