Fix C enum forward declarations in some target languages (notably Java)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13030 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d6cef9337f
commit
73b0431fbc
8 changed files with 119 additions and 2 deletions
|
|
@ -886,7 +886,22 @@ class TypePass:private Dispatcher {
|
|||
|
||||
// Use enumDeclaration() to do all the hard work.
|
||||
// Note that no children can be emitted in a forward declaration as there aren't any.
|
||||
return enumDeclaration(n);
|
||||
int result = enumDeclaration(n);
|
||||
if (result == SWIG_OK) {
|
||||
// Detect when the real enum matching the forward enum declaration has not been parsed/declared
|
||||
SwigType *ty = SwigType_typedef_resolve_all(Getattr(n, "type"));
|
||||
Replaceall(ty, "enum ", "");
|
||||
Node *nn = Swig_symbol_clookup(ty, 0);
|
||||
|
||||
String *nodetype = nn ? nodeType(nn) : 0;
|
||||
if (nodetype) {
|
||||
if (Equal(nodetype, "enumforward")) {
|
||||
SetFlag(nn, "enumMissing");
|
||||
} // if a real enum was declared this would be an "enum" node type
|
||||
}
|
||||
Delete(ty);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_OVERLOADED
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue