Skip to content

Commit

Permalink
Escape strings in �nnotate attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaoliello committed Sep 23, 2024
1 parent 4d07e05 commit a24b45f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6817,8 +6817,8 @@ private void WithAttributes(NamedDecl namedDecl, bool onlySupportedOSPlatform =

case CX_AttrKind_Annotate:
{
var annotationText = attr.Spelling;
outputBuilder.WriteCustomAttribute($"""NativeAnnotation("{annotationText}")""");
var annotationText = attr.Spelling.Replace("\"", "\"\"", StringComparison.Ordinal);
outputBuilder.WriteCustomAttribute($"""NativeAnnotation(@"{annotationText}")""");
break;
}

Expand Down

0 comments on commit a24b45f

Please sign in to comment.