Browse Source

Improve CS_INTERNAL so it now applies to all declarations.

Signed-off-by: Joao Matos <joao@tritao.eu>
pull/1276/head
Joao Matos 6 years ago
parent
commit
899e8d2caa
  1. 9
      src/Generator/Passes/CheckMacrosPass.cs

9
src/Generator/Passes/CheckMacrosPass.cs

@ -42,7 +42,7 @@ namespace CppSharp.Passes @@ -42,7 +42,7 @@ namespace CppSharp.Passes
/// CS_CONSTRAINT(TYPE [, TYPE]*) (templates)
/// Used to define constraint of generated generic type or generic method.
///
/// CS_INTERNAL (methods)
/// CS_INTERNAL (declarations)
/// Used to flag a method as internal to an assembly. So, it is
/// not accessible outside that assembly.
///
@ -60,7 +60,6 @@ namespace CppSharp.Passes @@ -60,7 +60,6 @@ namespace CppSharp.Passes
public override bool VisitDeclaration(Declaration decl)
{
if (AlreadyVisited(decl))
return false;
@ -69,6 +68,9 @@ namespace CppSharp.Passes @@ -69,6 +68,9 @@ namespace CppSharp.Passes
var expansions = decl.PreprocessedEntities.OfType<MacroExpansion>();
if (expansions.Any(e => e.Text == Prefix + "_INTERNAL"))
decl.Access = AccessSpecifier.Internal;
CheckIgnoreMacros(decl, expansions);
return true;
}
@ -160,9 +162,6 @@ namespace CppSharp.Passes @@ -160,9 +162,6 @@ namespace CppSharp.Passes
|| e.Text == Prefix + "_EQUALS"))
method.ExplicitlyIgnore();
if (expansions.Any(e => e.Text == Prefix + "_INTERNAL"))
method.Access = AccessSpecifier.Internal;
return base.VisitMethodDecl(method);
}

Loading…
Cancel
Save