From 0ab0f8790e0f62cacfac90d5d0f25964fecc688f Mon Sep 17 00:00:00 2001 From: Daniel Paoliello Date: Mon, 23 Sep 2024 10:19:04 -0700 Subject: [PATCH] Escape strings in nnotate attributes --- sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs index d3b9bb84..e973324a 100644 --- a/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs +++ b/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs @@ -6817,7 +6817,7 @@ private void WithAttributes(NamedDecl namedDecl, bool onlySupportedOSPlatform = case CX_AttrKind_Annotate: { - var annotationText = attr.Spelling; + var annotationText = EscapeString(attr.Spelling); outputBuilder.WriteCustomAttribute($"""NativeAnnotation("{annotationText}")"""); break; }