Browse Source

Added an hack for parsing declaration without unique native pointers.

We only need this because we're re-using the parameter declaration for function type parameters.
pull/329/head
triton 12 years ago
parent
commit
8a3f50337c
  1. 3
      src/Core/Parser/ASTConverter.cs
  2. 8
      src/CppParser/Parser.cpp

3
src/Core/Parser/ASTConverter.cs

@ -698,6 +698,9 @@ namespace CppSharp @@ -698,6 +698,9 @@ namespace CppSharp
bool CheckForDuplicates(Declaration decl)
{
if (decl.OriginalPtr == (void*) (0x1))
return false;
return !(decl is PreprocessedEntity);
}

8
src/CppParser/Parser.cpp

@ -44,6 +44,9 @@ @@ -44,6 +44,9 @@
using namespace CppSharp::CppParser;
// We use this as a placeholder for pointer values that should be ignored.
void* IgnorePtr = (void*) 0x1;
//-----------------------------------//
Parser::Parser(ParserOptions* Opts) : Lib(Opts->ASTContext), Opts(Opts), Index(0)
@ -1746,6 +1749,11 @@ Type* Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL, @@ -1746,6 +1749,11 @@ Type* Parser::WalkType(clang::QualType QualType, clang::TypeLoc* TL,
auto Arg = FP->getParamType(i);
FA->Name = "";
FA->QualifiedType = GetQualifiedType(Arg, WalkType(Arg));
// In this case we have no valid value to use as a pointer so
// use a special value known to the managed side to make sure
// it gets ignored.
FA->OriginalPtr = IgnorePtr;
}
F->Parameters.push_back(FA);
}

Loading…
Cancel
Save