Browse Source

Fixed invalid names of static field (variables).

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/361/head
Dimitar Dobrev 11 years ago
parent
commit
88293d5c84
  1. 6
      src/Generator/Passes/CleanInvalidDeclNamesPass.cs
  2. 2
      tests/CSharpTemp/CSharpTemp.h

6
src/Generator/Passes/CleanInvalidDeclNamesPass.cs

@ -123,6 +123,12 @@ namespace CppSharp.Passes
return base.VisitTypedefDecl(typedef); return base.VisitTypedefDecl(typedef);
} }
public override bool VisitVariableDecl(Variable variable)
{
variable.Name = CheckName(variable.Name);
return base.VisitVariableDecl(variable);
}
private static void CheckEnumName(Enumeration @enum) private static void CheckEnumName(Enumeration @enum)
{ {
// If we still do not have a valid name, then try to guess one // If we still do not have a valid name, then try to guess one

2
tests/CSharpTemp/CSharpTemp.h

@ -10,6 +10,8 @@ public:
int& operator[](int i); int& operator[](int i);
int A; int A;
static int null;
protected: protected:
int P; int P;
}; };

Loading…
Cancel
Save