From f6ca256a86035588aa1fbcded9fd44a6564855c8 Mon Sep 17 00:00:00 2001 From: triton Date: Sun, 6 Apr 2014 20:46:03 +0100 Subject: [PATCH] Fixed CheckDuplicatedNamesPass to work with functions. --- src/Generator/Passes/CheckDuplicatedNamesPass.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Generator/Passes/CheckDuplicatedNamesPass.cs b/src/Generator/Passes/CheckDuplicatedNamesPass.cs index c8ee5c3c..fe3f8b6f 100644 --- a/src/Generator/Passes/CheckDuplicatedNamesPass.cs +++ b/src/Generator/Passes/CheckDuplicatedNamesPass.cs @@ -118,6 +118,18 @@ namespace CppSharp.Passes return false; } + public override bool VisitFunctionDecl(Function decl) + { + if (!VisitDeclaration(decl)) + return false; + + if (ASTUtils.CheckIgnoreFunction(decl)) + return false; + + CheckDuplicate(decl); + return false; + } + public override bool VisitMethodDecl(Method decl) { if (!VisitDeclaration(decl)) @@ -145,6 +157,9 @@ namespace CppSharp.Passes foreach (var method in @class.Methods) VisitMethodDecl(method); + foreach (var function in @class.Functions) + VisitFunctionDecl(function); + foreach (var field in @class.Fields) VisitFieldDecl(field);