|
|
@ -1713,8 +1713,13 @@ CppSharp::AST::Enumeration^ Parser::WalkEnum(clang::EnumDecl* ED) |
|
|
|
auto NS = GetNamespace(ED); |
|
|
|
auto NS = GetNamespace(ED); |
|
|
|
assert(NS && "Expected a valid namespace"); |
|
|
|
assert(NS && "Expected a valid namespace"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto E = NS->FindEnum(System::IntPtr(ED->getCanonicalDecl())); |
|
|
|
|
|
|
|
if (E && !E->IsIncomplete) |
|
|
|
|
|
|
|
return E; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!E) |
|
|
|
|
|
|
|
{ |
|
|
|
auto Name = marshalString<E_UTF8>(GetTagDeclName(ED)); |
|
|
|
auto Name = marshalString<E_UTF8>(GetTagDeclName(ED)); |
|
|
|
CppSharp::AST::Enumeration^ E = nullptr; |
|
|
|
|
|
|
|
if (!System::String::IsNullOrEmpty(Name)) |
|
|
|
if (!System::String::IsNullOrEmpty(Name)) |
|
|
|
E = NS->FindEnum(Name, /*Create=*/false); |
|
|
|
E = NS->FindEnum(Name, /*Create=*/false); |
|
|
|
else |
|
|
|
else |
|
|
@ -1728,17 +1733,20 @@ CppSharp::AST::Enumeration^ Parser::WalkEnum(clang::EnumDecl* ED) |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (E && !E->IsIncomplete) |
|
|
|
if (E && !E->IsIncomplete) |
|
|
|
return E; |
|
|
|
return E; |
|
|
|
|
|
|
|
|
|
|
|
if (!E) |
|
|
|
if (!E) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
auto Name = marshalString<E_UTF8>(GetTagDeclName(ED)); |
|
|
|
if (!System::String::IsNullOrEmpty(Name)) |
|
|
|
if (!System::String::IsNullOrEmpty(Name)) |
|
|
|
E = NS->FindEnum(Name, /*Create=*/true); |
|
|
|
E = NS->FindEnum(Name, /*Create=*/true); |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
E = gcnew CppSharp::AST::Enumeration(); |
|
|
|
E = gcnew CppSharp::AST::Enumeration(); |
|
|
|
|
|
|
|
E->Name = Name; |
|
|
|
E->Namespace = NS; |
|
|
|
E->Namespace = NS; |
|
|
|
NS->Enums->Add(E); |
|
|
|
NS->Enums->Add(E); |
|
|
|
} |
|
|
|
} |
|
|
|