--- old/src/jdk.jextract/share/classes/com/sun/tools/jextract/HeaderFile.java 2018-03-28 22:48:10.000000000 +0530 +++ new/src/jdk.jextract/share/classes/com/sun/tools/jextract/HeaderFile.java 2018-03-28 22:48:09.000000000 +0530 @@ -112,6 +112,20 @@ ctx.err.println(Main.format("warn.symbol.not.found", name)); } } + + // C structs and unions can have nested structs, unions and enums. + if (c.kind() == CursorKind.StructDecl || + c.kind() == CursorKind.UnionDecl) { + c.children() + .filter(c1 -> c1.isDeclaration() && + (c1.kind() == CursorKind.StructDecl || + c1.kind() == CursorKind.UnionDecl || + c1.kind() == CursorKind.EnumDecl)) + .peek(c1 -> logger.finest( + () -> "Cursor: " + c1.spelling() + "@" + c1.USR() + "?" + c1.isDeclaration())) + .forEach(c1 -> processCursor(c1, main, isBuiltIn)); + } + JType jt = dict.computeIfAbsent(t, type -> { logger.fine(() -> "PH: Compute type for " + type.spelling()); return define(type);