Browse Source

Fixed parsing bug and subsequent failing test in GenerateEnumFromMacros.

It now uses preprocessed entities instead of the soon-to-be-removed macros.
pull/155/merge
triton 12 years ago
parent
commit
8c0adad5f1
  1. 2
      src/CppParser/Parser.cpp
  2. 2
      src/Generator/Library.cs

2
src/CppParser/Parser.cpp

@ -2111,7 +2111,7 @@ void Parser::HandleDeclaration(clang::Decl* D, Declaration* Decl) @@ -2111,7 +2111,7 @@ void Parser::HandleDeclaration(clang::Decl* D, Declaration* Decl)
Decl->OriginalPtr = (void*) D;
if (!Decl->PreprocessedEntities.empty())
if (Decl->PreprocessedEntities.empty())
{
if (clang::dyn_cast<clang::TranslationUnitDecl>(D))
{

2
src/Generator/Library.cs

@ -131,7 +131,7 @@ namespace CppSharp @@ -131,7 +131,7 @@ namespace CppSharp
foreach (var unit in context.TranslationUnits)
{
foreach (var macro in unit.Macros)
foreach (var macro in unit.PreprocessedEntities.OfType<MacroDefinition>())
{
var match = regex.Match(macro.Name);
if (!match.Success) continue;

Loading…
Cancel
Save