From d28c09d15e2df86fec672eb11a43c8d91b525e98 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 25 Sep 2017 21:22:22 -0300 Subject: [PATCH] generator: Make instance_offset as hiding inherited member --- Source/generator/ClassBase.cs | 2 +- Source/generator/StructBase.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/generator/ClassBase.cs b/Source/generator/ClassBase.cs index 09a84b6d1..fed3c4a79 100644 --- a/Source/generator/ClassBase.cs +++ b/Source/generator/ClassBase.cs @@ -195,7 +195,7 @@ namespace GtkSharp.Generation { if (cs_parent_struct == "") sw.WriteLine ("\t\tpublic static uint instance_offset { get { return 0; }}"); else - sw.WriteLine ("\t\tpublic static uint instance_offset {{ get {{ return ((uint) Marshal.SizeOf(typeof ({0})) + {1}.instance_offset); }} }}", cs_parent_struct, cs_parent); + sw.WriteLine ("\t\tpublic static new uint instance_offset {{ get {{ return ((uint) Marshal.SizeOf(typeof ({0})) + {1}.instance_offset); }} }}", cs_parent_struct, cs_parent); } protected void GenerateStructureABI (GenerationInfo gen_info) diff --git a/Source/generator/StructBase.cs b/Source/generator/StructBase.cs index dbcbc62bc..861d10faf 100644 --- a/Source/generator/StructBase.cs +++ b/Source/generator/StructBase.cs @@ -64,7 +64,7 @@ namespace GtkSharp.Generation { if (cs_parent_struct == "") sw.WriteLine ("\t\tpublic 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 new uint instance_offset {{ get {{ return ((uint) Marshal.SizeOf(typeof ({0})) + base.instance_offset); }} }}", cs_parent_struct); } public override string DefaultValue {