-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]in…
…t'. (#13043) * [generator] Use '[U]IntPtr' in the P/Invoke signature for native enums. * Use '[U]IntPtr' as the parameter type in the P/Invoke signature for native enum parameters. * Use '[U]IntPtr' in the P/Invoke method name for native enum parameters. * Add an explicit conversion from UIntPtr to nuint (like we already have from IntPtr to nint). This makes the code identical between .NET and legacy Xamarin when using C# n[u]ints, because those are really [U]IntPtrs. * Use IntPtr/UIntPtr for all nint/nuint types in P/Invokes, not only native enums. * Add a few more casts Fixes these generator tests: * GeneratorTests.BGenTests.FieldEnumTests * GeneratorTests.BGenTests.NativeEnum * [registrar] Handle UIntPtr like we do IntPtr. Fixes this error in numerous tests: error MT4169: Failed to generate a P/Invoke wrapper for objc_msgSend(System.IntPtr,System.IntPtr): The registrar cannot build a signature for type `System.Void' in method `ObjCRuntime.Messaging.objc_msgSend`. * [NativeTypes] Make IntPtr and UIntPtr behave the same. This fixes an issue where the linked output for a 32-bit mscorlib.dll and a 64-bit mscorlib.dll would be different, because different explicit operators for UIntPtr would be kept. The fix works because the conversion operators for nuint will not use UIntPtr's explicit conversion operators anymore, it will just operate on plain memory instead.
- Loading branch information
1 parent
2ff5743
commit c3574a5
Showing
8 changed files
with
67 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c3574a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ [CI Build] Tests failed on Build ❌
Tests failed on Build.
API diff
✅ API Diff from stable
View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff
Packages generated
View packages
Test results
2 tests failed, 216 tests passed.
Failed tests
Tests run: 11 Passed: 6 Inconclusive: 0 Failed: 0 Ignored: 5)
Pipeline on Agent XAMBOT-1036.BigSur
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]int'. (#13043)
c3574a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 Tests failed catastrophically on VSTS: device tests iOS 🔥
Not enough free space in the host.
Pipeline on Agent
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]int'. (#13043)
c3574a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]int'. (#13043)
c3574a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.
Pipeline on Agent
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]int'. (#13043)
c3574a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Tests failed on macOS M1 - Mac Big Sur (11.5) ❌
Tests failed on M1 - Mac Big Sur (11.5).
Failed tests are:
Pipeline on Agent
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]int'. (#13043)
c3574a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Tests passed on macOS Mac Mojave (10.14) ✅
Tests passed
All tests on macOS X Mac Mojave (10.14) passed.
Pipeline on Agent
[generator] Use '[U]IntPtr' in P/Invoke signatures instead of 'n[u]int'. (#13043)