diff options
Diffstat (limited to 'src/net/java/games/gluegen/ReferencedStructs.java')
-rw-r--r-- | src/net/java/games/gluegen/ReferencedStructs.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/net/java/games/gluegen/ReferencedStructs.java b/src/net/java/games/gluegen/ReferencedStructs.java index 1b3b75198..4a7a8aadf 100644 --- a/src/net/java/games/gluegen/ReferencedStructs.java +++ b/src/net/java/games/gluegen/ReferencedStructs.java @@ -54,7 +54,18 @@ public class ReferencedStructs implements TypeVisitor { } public void visitType(Type t) { - if (t.isCompound()) { + if (t.isPointer()) { + PointerType p = t.asPointer(); + if (p.hasTypedefedName()) { + CompoundType c = p.getTargetType().asCompound(); + if (c != null && c.getName() == null) { + // This otherwise-unnamed CompoundType is referred to by a + // PointerType that has a typedef name. Assume that it is + // referred to in the glue code and emit it. + results.add(p); + } + } + } else if (t.isCompound()) { results.add(t); } } |