From 28ef800fd956d7eec75205408a629f04b4219305 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Sun, 10 Oct 2021 09:30:27 -0700 Subject: [PATCH] Ensure anonymous unions stay "anonymous" and not "unnamed" --- sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs | 5 +++++ 1 file changed, 5 insertions(+) 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)