diff --git a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs index d69e41a0..df5ef2d4 100644 --- a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs +++ b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs @@ -1529,6 +1529,11 @@ private string GetTypeName(Cursor cursor, Cursor context, Type rootType, Type ty name = name.Replace("unnamed struct at", "anonymous struct at"); } + if (name.Contains("unnamed union at")) + { + name = name.Replace("unnamed union at", "anonymous union at"); + } + nativeTypeName = name; if (type is ArrayType arrayType)