The code generator adds unsafe to functions that use pointers, but not fixed size buffers. This results in error CS0214: Pointers and fixed size buffers may only be used in an unsafe context
See microsoft/wdkmetadata#87 for an example.
Relevant code:
|
private bool IsUnsafe(NamedDecl namedDecl, Type type) |
private bool IsUnsafe(NamedDecl namedDecl, Type type)
{
var remappedName = GetRemappedTypeName(namedDecl, context: null, type, out _, skipUsing: true, ignoreTransparentStructsWhereRequired: false);
return remappedName.Contains('*', StringComparison.Ordinal);
}
The code generator adds unsafe to functions that use pointers, but not fixed size buffers. This results in
error CS0214: Pointers and fixed size buffers may only be used in an unsafe contextSee microsoft/wdkmetadata#87 for an example.
Relevant code:
ClangSharp/sources/ClangSharp.PInvokeGenerator/PInvokeGenerator.cs
Line 6217 in 4c866fb