diff options
author | DGA45 <59612603+DGA45@users.noreply.github.com> | 2020-02-03 14:01:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 14:01:36 (GMT) |
commit | 7bd775a7d8c4d74ce075ba3bb399c5dbff08b325 (patch) | |
tree | e6b99f5eaf819676982b55611a4e7b5c10e0e842 /src | |
parent | b5fa3cd1c6e6240e20d3b80a70e3f04040b32021 (diff) | |
download | Doxygen-7bd775a7d8c4d74ce075ba3bb399c5dbff08b325.zip Doxygen-7bd775a7d8c4d74ce075ba3bb399c5dbff08b325.tar.gz Doxygen-7bd775a7d8c4d74ce075ba3bb399c5dbff08b325.tar.bz2 |
Fix #7556 ANSI-C anonymous (unnamed) struct/unions duplicated names
Fix ANSI-C anonymous (unnamed) struct/unions duplicated names issue
Diffstat (limited to 'src')
-rw-r--r-- | src/doxygen.cpp | 3 | ||||
-rw-r--r-- | src/perlmodgen.cpp | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 6388ce3..957c3ae 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1389,7 +1389,8 @@ static void processTagLessClasses(ClassDef *rootCd, if (type.find(icd->name())!=-1) // matching tag less struct/union { QCString name = md->name(); - if (md->isAnonymous()) name = "__unnamed__"; + /* DGA fix #7556 ANSI-C anonymous (unnamed) struct/unions have duplicated names (__unnamed__) */ + if (md->isAnonymous()) name = "__unnamed__" + name.right(name.length()-1); /* DGA: ensure unique name */ if (!prefix.isEmpty()) name.prepend(prefix+"."); //printf(" found %s for class %s\n",name.data(),cd->name().data()); ClassDef *ncd = createTagLessInstance(rootCd,icd,name); diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 4ecee5e..7da71ce 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -1573,6 +1573,7 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini // (templateArguments(), definitionTemplateParameterLists()) QCString memType; + QCString name; bool isFunc=FALSE; switch (md->memberType()) { @@ -1594,9 +1595,13 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini case MemberType_Dictionary: memType="dictionary"; break; } + /* DGA fix #7556 ANSI-C anonymous (unnamed) struct/unions have duplicated names (__unnamed__) */ + name = md->name(); + if (md->isAnonymous()) name = "__unnamed__" + name.right(name.length() - 1); /* DGA: ensure unique name */ + m_output.openHash() .addFieldQuotedString("kind", memType) - .addFieldQuotedString("name", md->name()) + .addFieldQuotedString("name", name) .addFieldQuotedString("virtualness", getVirtualnessName(md->virtualness())) .addFieldQuotedString("protection", getProtectionName(md->protection())) .addFieldBoolean("static", md->isStatic()); |