2006-02-09 Joe Shaw <joeshaw@novell.com
authorJoe Shaw <joeshaw@novell.com>
Thu, 9 Feb 2006 19:57:42 +0000 (19:57 +0000)
committerJoe Shaw <joeshaw@novell.com>
Thu, 9 Feb 2006 19:57:42 +0000 (19:57 +0000)
* mono/Arguments.cs: Fix a magic number in the mono bindings
that doesn't work on 64 bit arches.  Patch from Peter Johanson.

ChangeLog
mono/Arguments.cs

index 7ac2e4a..ab8c1a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-09  Joe Shaw  <joeshaw@novell.com
+
+       * mono/Arguments.cs: Fix a magic number in the mono bindings
+       that doesn't work on 64 bit arches.  Patch from Peter Johanson.
+
 2006-01-27  Robert McQueen  <robot101@debian.org>
 
        * glib/dbus-binding-tool-glib.[ch]: Patch based on Ricardo Kekki's
index 61ae443..25f89da 100644 (file)
@@ -10,7 +10,7 @@ namespace DBus
        public class Arguments : IEnumerable, IDisposable
   {
     // Must follow sizeof(DBusMessageIter)
-    internal const int DBusMessageIterSize = 14*4;
+    internal static readonly int DBusMessageIterSize = Marshal.SizeOf (typeof(_DBusMessageIter));
     private static Hashtable dbusTypes = null;
     private Message message;
     private IntPtr appenderIter;
@@ -240,6 +240,25 @@ namespace DBus
       return new ArgumentsEnumerator(this);
     }
 
+    [StructLayout(LayoutKind.Sequential)]
+    private class _DBusMessageIter
+    {
+       IntPtr dummy1;
+       IntPtr dummy2;
+       int    dummy3;
+       int    dummy4;
+       int    dummy5;
+       int    dummy6;
+       int    dummy7;
+       int    dummy8;
+       int    dummy9;
+       int    dummy10;
+       int    dummy11;
+       int    pad1;
+       int    pad2;
+       IntPtr pad3;
+   }
+           
     private class ArgumentsEnumerator : IEnumerator
     {
       private Arguments arguments;