Browse Source

Added synthetized check on block generation of ObjectOverridesPass.cs so already existing methods are not modified.

pull/13/head
marcos henrich 13 years ago
parent
commit
4875addfb4
  1. 4
      src/Generator/Passes/ObjectOverridesPass.cs

4
src/Generator/Passes/ObjectOverridesPass.cs

@ -16,12 +16,16 @@ namespace CppSharp @@ -16,12 +16,16 @@ namespace CppSharp
foreach (var block in template.FindBlocks(CLIBlockKind.MethodBody))
{
var method = block.Declaration as Method;
if (!method.IsSynthetized)
continue;
switch (method.Name)
{
case "GetHashCode":
block.Write("return (int)NativePtr;");
break;
case "Equals":
block.WriteLine("if (!object) return false;");
block.Write("return Instance == safe_cast<ICppInstance^>({0})->Instance;",
method.Parameters[0].Name);

Loading…
Cancel
Save