mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 01:55:30 +00:00
Make usage of Marshal.OffsetOf AOT friendly
This commit is contained in:
parent
116762af89
commit
24392d01ea
|
@ -18,7 +18,7 @@ namespace GLib {
|
||||||
, (uint) sizeof (ulong) // seq_id
|
, (uint) sizeof (ulong) // seq_id
|
||||||
, null
|
, null
|
||||||
, "hook_size"
|
, "hook_size"
|
||||||
, (long) Marshal.OffsetOf(typeof(GHookList_seq_idAlign), "seq_id")
|
, (long) Marshal.OffsetOf<GHookList_seq_idAlign>("seq_id")
|
||||||
, 0
|
, 0
|
||||||
),
|
),
|
||||||
new GLib.AbiField("hook_size"
|
new GLib.AbiField("hook_size"
|
||||||
|
@ -42,7 +42,7 @@ namespace GLib {
|
||||||
, (uint) sizeof (IntPtr) // hooks
|
, (uint) sizeof (IntPtr) // hooks
|
||||||
, "is_setup"
|
, "is_setup"
|
||||||
, "dummy3"
|
, "dummy3"
|
||||||
, (long) Marshal.OffsetOf(typeof(GHookList_hooksAlign), "hooks")
|
, (long) Marshal.OffsetOf<GHookList_hooksAlign>("hooks")
|
||||||
, 0
|
, 0
|
||||||
),
|
),
|
||||||
new GLib.AbiField("dummy3"
|
new GLib.AbiField("dummy3"
|
||||||
|
@ -50,7 +50,7 @@ namespace GLib {
|
||||||
, (uint) sizeof (IntPtr) // dummy3
|
, (uint) sizeof (IntPtr) // dummy3
|
||||||
, "hooks"
|
, "hooks"
|
||||||
, "finalize_hook"
|
, "finalize_hook"
|
||||||
, (long) Marshal.OffsetOf(typeof(GHookList_dummy3Align), "dummy3")
|
, (long) Marshal.OffsetOf<GHookList_dummy3Align>("dummy3")
|
||||||
, 0
|
, 0
|
||||||
),
|
),
|
||||||
new GLib.AbiField("finalize_hook"
|
new GLib.AbiField("finalize_hook"
|
||||||
|
@ -58,7 +58,7 @@ namespace GLib {
|
||||||
, (uint) sizeof (IntPtr) // finalize_hook
|
, (uint) sizeof (IntPtr) // finalize_hook
|
||||||
, "dummy3"
|
, "dummy3"
|
||||||
, "dummy"
|
, "dummy"
|
||||||
, (long) Marshal.OffsetOf(typeof(GHookList_finalize_hookAlign), "finalize_hook")
|
, (long) Marshal.OffsetOf<GHookList_finalize_hookAlign>("finalize_hook")
|
||||||
, 0
|
, 0
|
||||||
),
|
),
|
||||||
new GLib.AbiField("dummy"
|
new GLib.AbiField("dummy"
|
||||||
|
@ -66,7 +66,7 @@ namespace GLib {
|
||||||
, (uint) sizeof (IntPtr) * 2 // dummy
|
, (uint) sizeof (IntPtr) * 2 // dummy
|
||||||
, "finalize_hook"
|
, "finalize_hook"
|
||||||
, null
|
, null
|
||||||
, (long) Marshal.OffsetOf(typeof(GHookList_dummyAlign), "dummy")
|
, (long) Marshal.OffsetOf<GHookList_dummyAlign>("dummy")
|
||||||
, 0
|
, 0
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -942,7 +942,7 @@ namespace GLib {
|
||||||
, (uint) sizeof (IntPtr) // g_type_instance
|
, (uint) sizeof (IntPtr) // g_type_instance
|
||||||
, null
|
, null
|
||||||
, "ref_count"
|
, "ref_count"
|
||||||
, (long) Marshal.OffsetOf(typeof(GObject_g_type_instanceAlign), "g_type_instance")
|
, (long) Marshal.OffsetOf<GObject_g_type_instanceAlign>("g_type_instance")
|
||||||
, 0
|
, 0
|
||||||
),
|
),
|
||||||
new GLib.AbiField("ref_count"
|
new GLib.AbiField("ref_count"
|
||||||
|
@ -950,7 +950,7 @@ namespace GLib {
|
||||||
, (uint) sizeof (uint) // ref_count
|
, (uint) sizeof (uint) // ref_count
|
||||||
, "g_type_instance"
|
, "g_type_instance"
|
||||||
, "qdata"
|
, "qdata"
|
||||||
, (long) Marshal.OffsetOf(typeof(GObject_ref_countAlign), "ref_count")
|
, (long) Marshal.OffsetOf<GObject_ref_countAlign>("ref_count")
|
||||||
, 0
|
, 0
|
||||||
),
|
),
|
||||||
new GLib.AbiField("qdata"
|
new GLib.AbiField("qdata"
|
||||||
|
@ -958,7 +958,7 @@ namespace GLib {
|
||||||
, (uint) sizeof (IntPtr) // qdata
|
, (uint) sizeof (IntPtr) // qdata
|
||||||
, "ref_count"
|
, "ref_count"
|
||||||
, null
|
, null
|
||||||
, (long) Marshal.OffsetOf(typeof(GObject_qdataAlign), "qdata")
|
, (long) Marshal.OffsetOf<GObject_qdataAlign>("qdata")
|
||||||
, 0
|
, 0
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace GtkSharp.Generation {
|
||||||
var fieldname = SymbolTable.Table.MangleName (CName).Replace(".", "_");
|
var fieldname = SymbolTable.Table.MangleName (CName).Replace(".", "_");
|
||||||
if (IsArray && IsNullTermArray)
|
if (IsArray && IsNullTermArray)
|
||||||
fieldname += "Ptr";
|
fieldname += "Ptr";
|
||||||
sw.WriteLine(indent + ", (long) Marshal.OffsetOf(typeof(" + alig_struct_name + "), \"" + fieldname + "\")");
|
sw.WriteLine(indent + ", (long) Marshal.OffsetOf<" + alig_struct_name + ">(\"" + fieldname + "\")");
|
||||||
} else {
|
} else {
|
||||||
sw.WriteLine(indent + ", " + min_align);
|
sw.WriteLine(indent + ", " + min_align);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue