mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-22 14:45:33 +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
|
||||
, null
|
||||
, "hook_size"
|
||||
, (long) Marshal.OffsetOf(typeof(GHookList_seq_idAlign), "seq_id")
|
||||
, (long) Marshal.OffsetOf<GHookList_seq_idAlign>("seq_id")
|
||||
, 0
|
||||
),
|
||||
new GLib.AbiField("hook_size"
|
||||
|
@ -42,7 +42,7 @@ namespace GLib {
|
|||
, (uint) sizeof (IntPtr) // hooks
|
||||
, "is_setup"
|
||||
, "dummy3"
|
||||
, (long) Marshal.OffsetOf(typeof(GHookList_hooksAlign), "hooks")
|
||||
, (long) Marshal.OffsetOf<GHookList_hooksAlign>("hooks")
|
||||
, 0
|
||||
),
|
||||
new GLib.AbiField("dummy3"
|
||||
|
@ -50,7 +50,7 @@ namespace GLib {
|
|||
, (uint) sizeof (IntPtr) // dummy3
|
||||
, "hooks"
|
||||
, "finalize_hook"
|
||||
, (long) Marshal.OffsetOf(typeof(GHookList_dummy3Align), "dummy3")
|
||||
, (long) Marshal.OffsetOf<GHookList_dummy3Align>("dummy3")
|
||||
, 0
|
||||
),
|
||||
new GLib.AbiField("finalize_hook"
|
||||
|
@ -58,7 +58,7 @@ namespace GLib {
|
|||
, (uint) sizeof (IntPtr) // finalize_hook
|
||||
, "dummy3"
|
||||
, "dummy"
|
||||
, (long) Marshal.OffsetOf(typeof(GHookList_finalize_hookAlign), "finalize_hook")
|
||||
, (long) Marshal.OffsetOf<GHookList_finalize_hookAlign>("finalize_hook")
|
||||
, 0
|
||||
),
|
||||
new GLib.AbiField("dummy"
|
||||
|
@ -66,7 +66,7 @@ namespace GLib {
|
|||
, (uint) sizeof (IntPtr) * 2 // dummy
|
||||
, "finalize_hook"
|
||||
, null
|
||||
, (long) Marshal.OffsetOf(typeof(GHookList_dummyAlign), "dummy")
|
||||
, (long) Marshal.OffsetOf<GHookList_dummyAlign>("dummy")
|
||||
, 0
|
||||
)
|
||||
}
|
||||
|
|
|
@ -942,7 +942,7 @@ namespace GLib {
|
|||
, (uint) sizeof (IntPtr) // g_type_instance
|
||||
, null
|
||||
, "ref_count"
|
||||
, (long) Marshal.OffsetOf(typeof(GObject_g_type_instanceAlign), "g_type_instance")
|
||||
, (long) Marshal.OffsetOf<GObject_g_type_instanceAlign>("g_type_instance")
|
||||
, 0
|
||||
),
|
||||
new GLib.AbiField("ref_count"
|
||||
|
@ -950,7 +950,7 @@ namespace GLib {
|
|||
, (uint) sizeof (uint) // ref_count
|
||||
, "g_type_instance"
|
||||
, "qdata"
|
||||
, (long) Marshal.OffsetOf(typeof(GObject_ref_countAlign), "ref_count")
|
||||
, (long) Marshal.OffsetOf<GObject_ref_countAlign>("ref_count")
|
||||
, 0
|
||||
),
|
||||
new GLib.AbiField("qdata"
|
||||
|
@ -958,7 +958,7 @@ namespace GLib {
|
|||
, (uint) sizeof (IntPtr) // qdata
|
||||
, "ref_count"
|
||||
, null
|
||||
, (long) Marshal.OffsetOf(typeof(GObject_qdataAlign), "qdata")
|
||||
, (long) Marshal.OffsetOf<GObject_qdataAlign>("qdata")
|
||||
, 0
|
||||
),
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace GtkSharp.Generation {
|
|||
var fieldname = SymbolTable.Table.MangleName (CName).Replace(".", "_");
|
||||
if (IsArray && IsNullTermArray)
|
||||
fieldname += "Ptr";
|
||||
sw.WriteLine(indent + ", (long) Marshal.OffsetOf(typeof(" + alig_struct_name + "), \"" + fieldname + "\")");
|
||||
sw.WriteLine(indent + ", (long) Marshal.OffsetOf<" + alig_struct_name + ">(\"" + fieldname + "\")");
|
||||
} else {
|
||||
sw.WriteLine(indent + ", " + min_align);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue