mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 00:25:27 +00:00
generator: Mark instance_offset field as static
Those are per class and should not be overriden ever
This commit is contained in:
parent
9539c0b17b
commit
d1457f6e03
|
@ -190,10 +190,12 @@ namespace GtkSharp.Generation {
|
|||
|
||||
protected virtual void WriteInstanceOffsetMethod(StreamWriter sw,
|
||||
string cs_parent_struct) {
|
||||
string cs_parent = SymbolTable.Table.GetCSType(Elem.GetAttribute("parent"));
|
||||
|
||||
if (cs_parent_struct == "")
|
||||
sw.WriteLine ("\t\tpublic virtual uint instance_offset { get { return 0; }}");
|
||||
sw.WriteLine ("\t\tpublic static uint instance_offset { get { return 0; }}");
|
||||
else
|
||||
sw.WriteLine ("\t\tpublic override uint instance_offset {{ get {{ return ((uint) Marshal.SizeOf(typeof ({0})) + base.instance_offset); }} }}", cs_parent_struct);
|
||||
sw.WriteLine ("\t\tpublic static uint instance_offset {{ get {{ return ((uint) Marshal.SizeOf(typeof ({0})) + {1}.instance_offset); }} }}", cs_parent_struct, cs_parent);
|
||||
}
|
||||
|
||||
protected void GenerateStructureABI (GenerationInfo gen_info)
|
||||
|
|
|
@ -823,7 +823,7 @@ namespace GLib {
|
|||
public IntPtr g_class;
|
||||
}
|
||||
|
||||
public virtual uint instance_offset { get { return 0; }}
|
||||
public static uint instance_offset { get { return 0; }}
|
||||
public uint GetFieldOffset(string field) { throw new NotImplementedException(); return 0; }
|
||||
public struct GObject {
|
||||
public GTypeInstance type_instance;
|
||||
|
|
Loading…
Reference in a new issue