< prev index next >

src/jdk.jextract/share/classes/com/sun/tools/jextract/HeaderFile.java

Print this page
rev 47744 : jextract tool
rev 49470 : [mq]: 8200452

@@ -110,15 +110,27 @@
 
                 if (!ctx.isSymbolFound(name)) {
                     ctx.err.println(Main.format("warn.symbol.not.found", name));
                 }
             }
+
             JType jt = dict.computeIfAbsent(t, type -> {
                 logger.fine(() -> "PH: Compute type for " + type.spelling());
                 return define(type);
             });
             assert (jt instanceof JType2);
+
+            if (t.kind() == TypeKind.Typedef) {
+                // Enum is already an TypeAlias for int with proper name
+                // In case of typedef has a different name with enum, do we care?
+                // Typedef is a type annotation, has no real use case
+                if (t.canonicalType().kind() == TypeKind.Enum) {
+                    logger.finest("Skip enum typedef for " + t.spelling());
+                    return;
+                }
+            }
+
             // Only main file can define interface
             if (cf != null && this.main == main) {
                 cf.addType(jt, c);
             }
         } else if (c.isPreprocessing()) {
< prev index next >