From 6f37c3cdbe175ca38c6a5586b7313c5f56a71e41 Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 29 May 2013 19:23:36 +0100 Subject: [PATCH] Added support for variables to CheckIgnoredDecls pass. --- src/Generator/Passes/CheckIgnoredDecls.cs | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/Generator/Passes/CheckIgnoredDecls.cs b/src/Generator/Passes/CheckIgnoredDecls.cs index 3e04747d..bdf61057 100644 --- a/src/Generator/Passes/CheckIgnoredDecls.cs +++ b/src/Generator/Passes/CheckIgnoredDecls.cs @@ -119,6 +119,31 @@ namespace CppSharp.Passes return true; } + public override bool VisitVariableDecl(Variable variable) + { + if (!VisitDeclaration(variable)) + return false; + + string msg; + if (HasInvalidDecl(variable, out msg)) + { + variable.ExplicityIgnored = true; + Console.WriteLine("Variable '{0}' was ignored due to {1} decl", + variable.Name, msg); + return false; + } + + if (HasInvalidType(variable.Type, out msg)) + { + variable.ExplicityIgnored = true; + Console.WriteLine("Variable '{0}' was ignored due to {1} type", + variable.Name, msg); + return false; + } + + return true; + } + #region Helpers ///