We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We need to implement AOT compatible C# async callback. Here is an example:
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })] private static void GenericCollectionConstraintOnComplete(System.IntPtr rawResult, IntPtr task) { GCHandle handle = GCHandle.FromIntPtr(task); try { var result = SwiftMarshal.MarshalFromSwift<System.IntPtr>((SwiftHandle)new IntPtr(&rawResult)); if (handle.Target is TaskCompletionSource<System.IntPtr> tcs) { tcs.TrySetResult(result); } } finally { handle.Free(); } }
The rawResult parameter should be generic type, which is not allowed in UnmanagedCallersOnly methods.
rawResult
UnmanagedCallersOnly
The text was updated successfully, but these errors were encountered:
kotlarmilos
No branches or pull requests
Description
We need to implement AOT compatible C# async callback. Here is an example:
The
rawResult
parameter should be generic type, which is not allowed inUnmanagedCallersOnly
methods.The text was updated successfully, but these errors were encountered: