diff --git a/src/AudioToolbox/AudioFile.cs b/src/AudioToolbox/AudioFile.cs index e9b91260e2b6..13233242252d 100644 --- a/src/AudioToolbox/AudioFile.cs +++ b/src/AudioToolbox/AudioFile.cs @@ -41,7 +41,6 @@ using CoreFoundation; using Foundation; -using OSStatus = System.Int32; using AudioFileID = System.IntPtr; #if !NET diff --git a/src/AudioToolbox/AudioFileStream.cs b/src/AudioToolbox/AudioFileStream.cs index 5405c0976fc0..5c6395deb45a 100644 --- a/src/AudioToolbox/AudioFileStream.cs +++ b/src/AudioToolbox/AudioFileStream.cs @@ -40,7 +40,6 @@ using CoreFoundation; using Foundation; -using OSStatus = System.Int32; using AudioFileStreamID = System.IntPtr; using System.Runtime.Versioning; diff --git a/src/AudioToolbox/AudioFormat.cs b/src/AudioToolbox/AudioFormat.cs index 4f408e1617d4..9cc52a2a2dd9 100644 --- a/src/AudioToolbox/AudioFormat.cs +++ b/src/AudioToolbox/AudioFormat.cs @@ -37,7 +37,6 @@ using Foundation; using ObjCRuntime; -using OSStatus = System.Int32; using AudioFileID = System.IntPtr; namespace AudioToolbox { diff --git a/src/AudioToolbox/AudioQueue.cs b/src/AudioToolbox/AudioQueue.cs index 861adfb17a66..3d2a248651d8 100644 --- a/src/AudioToolbox/AudioQueue.cs +++ b/src/AudioToolbox/AudioQueue.cs @@ -41,7 +41,6 @@ using Foundation; using ObjCRuntime; -using OSStatus = System.Int32; using AudioQueueParameterValue = System.Single; using AudioQueueRef = System.IntPtr; using AudioQueueTimelineRef = System.IntPtr; diff --git a/src/AudioToolbox/AudioToolbox.cs b/src/AudioToolbox/AudioToolbox.cs index 621e863476cb..61680bc4c4e0 100644 --- a/src/AudioToolbox/AudioToolbox.cs +++ b/src/AudioToolbox/AudioToolbox.cs @@ -13,8 +13,6 @@ using ObjCRuntime; using Foundation; -using OSStatus = System.Int32; - namespace AudioToolbox { #if NET diff --git a/src/CoreMedia/CMBufferQueue.cs b/src/CoreMedia/CMBufferQueue.cs index addc8b65ff01..223f0d87ec6e 100644 --- a/src/CoreMedia/CMBufferQueue.cs +++ b/src/CoreMedia/CMBufferQueue.cs @@ -17,7 +17,6 @@ using Foundation; using CoreFoundation; using ObjCRuntime; -using OSStatus = System.Int32; namespace CoreMedia { diff --git a/src/CoreMedia/CMSampleBuffer.cs b/src/CoreMedia/CMSampleBuffer.cs index 5f36e9c6f09e..952afa2d7539 100644 --- a/src/CoreMedia/CMSampleBuffer.cs +++ b/src/CoreMedia/CMSampleBuffer.cs @@ -14,17 +14,12 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Collections.Generic; +using System.ComponentModel; using Foundation; using CoreFoundation; using ObjCRuntime; -#if NET -using OSStatus = System.IntPtr; -#else -using OSStatus = System.nint; -#endif - #if !COREBUILD using AudioToolbox; using CoreVideo; @@ -121,6 +116,19 @@ unsafe static extern OSStatus CMSampleBufferCreateCopyWithNewTiming ( return CreateWithNewTiming (original, timing, out status); } +#if !XAMCORE_5_0 + // OSStatus was incorrectly defined as IntPtr in this file, so providing this overload to keep compatibility, + // while at the same time highly discourage using this overload. + [EditorBrowsable (EditorBrowsableState.Never)] + [OverloadResolutionPriorityAttribute (-1)] + public static CMSampleBuffer? CreateWithNewTiming (CMSampleBuffer original, CMSampleTimingInfo []? timing, out nint status) + { + var rv = CreateWithNewTiming (original, timing, out var actualStatus); + status = (nint) actualStatus; + return rv; + } +#endif // XAMCORE_5_0 + public unsafe static CMSampleBuffer? CreateWithNewTiming (CMSampleBuffer original, CMSampleTimingInfo []? timing, out OSStatus status) { if (original is null) @@ -475,6 +483,19 @@ unsafe static extern OSStatus CMSampleBufferGetSampleTimingInfoArray ( return GetSampleTimingInfo (out status); } +#if !XAMCORE_5_0 + // OSStatus was incorrectly defined as IntPtr in this file, so providing this overload to keep compatibility, + // while at the same time highly discourage using this overload. + [EditorBrowsable (EditorBrowsableState.Never)] + [OverloadResolutionPriorityAttribute (-1)] + public CMSampleTimingInfo []? GetSampleTimingInfo (out nint status) + { + var rv = GetSampleTimingInfo (out OSStatus actualStatus); + status = actualStatus; + return rv; + } +#endif // XAMCORE_5_0 + public unsafe CMSampleTimingInfo []? GetSampleTimingInfo (out OSStatus status) { nint count; diff --git a/src/CoreWlan/CWKeychain.cs b/src/CoreWlan/CWKeychain.cs index e4538798e60a..a09a3f894488 100644 --- a/src/CoreWlan/CWKeychain.cs +++ b/src/CoreWlan/CWKeychain.cs @@ -10,7 +10,6 @@ #nullable enable -using OSStatus = System.Int32; using SecIdentityRef = System.IntPtr; using CFArrayRef = System.IntPtr; using NSDataRef = System.IntPtr; diff --git a/src/DotNetGlobals.cs b/src/DotNetGlobals.cs index 0652e51f8cd1..b9eab5baed82 100644 --- a/src/DotNetGlobals.cs +++ b/src/DotNetGlobals.cs @@ -1,4 +1,6 @@ #if NET global using System; global using System.Runtime.Versioning; // We need the SupportedOSPlatform/UnsupportedOSPlatform attributes pretty much everywhere + +global using OSStatus = System.Int32; #endif diff --git a/src/ImageIO/CGImageSource.cs b/src/ImageIO/CGImageSource.cs index 96f2c0bfe0d9..2ae7c1f45ef7 100644 --- a/src/ImageIO/CGImageSource.cs +++ b/src/ImageIO/CGImageSource.cs @@ -41,8 +41,6 @@ using NativeHandle = System.IntPtr; #endif -using OSStatus = System.Int32; - namespace ImageIO { #if !COREBUILD diff --git a/src/PrintCore/Defs.cs b/src/PrintCore/Defs.cs index c14047cec7d1..d221d05f3117 100644 --- a/src/PrintCore/Defs.cs +++ b/src/PrintCore/Defs.cs @@ -17,7 +17,6 @@ using Foundation; using PMObject = System.IntPtr; -using OSStatus = System.Int32; using System.Runtime.Versioning; namespace PrintCore { diff --git a/src/PrintCore/PrintCore.cs b/src/PrintCore/PrintCore.cs index 722abd682853..3be56d5fa2f6 100644 --- a/src/PrintCore/PrintCore.cs +++ b/src/PrintCore/PrintCore.cs @@ -21,7 +21,6 @@ using CoreGraphics; using CoreFoundation; using PMObject = System.IntPtr; -using OSStatus = System.Int32; #if !NET using NativeHandle = System.IntPtr; diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index c58a9e545fdd..f96835361175 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -31190,7 +31190,7 @@ M:CoreMedia.CMSampleBuffer.CreateForImageBuffer(CoreVideo.CVImageBuffer,System.B M:CoreMedia.CMSampleBuffer.CreateReady(CoreMedia.CMBlockBuffer,CoreMedia.CMFormatDescription,System.Int32,CoreMedia.CMSampleTimingInfo[],System.UIntPtr[],CoreMedia.CMSampleBufferError@) M:CoreMedia.CMSampleBuffer.CreateReadyWithImageBuffer(CoreVideo.CVImageBuffer,CoreMedia.CMFormatDescription,CoreMedia.CMSampleTimingInfo@,CoreMedia.CMSampleBufferError@) M:CoreMedia.CMSampleBuffer.CreateReadyWithPacketDescriptions(CoreMedia.CMBlockBuffer,CoreMedia.CMFormatDescription,System.Int32,CoreMedia.CMTime,AudioToolbox.AudioStreamPacketDescription[],CoreMedia.CMSampleBufferError@) -M:CoreMedia.CMSampleBuffer.CreateWithNewTiming(CoreMedia.CMSampleBuffer,CoreMedia.CMSampleTimingInfo[],System.IntPtr@) +M:CoreMedia.CMSampleBuffer.CreateWithNewTiming(CoreMedia.CMSampleBuffer,CoreMedia.CMSampleTimingInfo[],System.Int32@) M:CoreMedia.CMSampleBuffer.CreateWithNewTiming(CoreMedia.CMSampleBuffer,CoreMedia.CMSampleTimingInfo[]) M:CoreMedia.CMSampleBuffer.CreateWithPacketDescriptions(CoreMedia.CMBlockBuffer,CoreMedia.CMFormatDescription,System.Int32,CoreMedia.CMTime,AudioToolbox.AudioStreamPacketDescription[],CoreMedia.CMSampleBufferError@) M:CoreMedia.CMSampleBuffer.Dispose(System.Boolean) @@ -31200,7 +31200,7 @@ M:CoreMedia.CMSampleBuffer.GetImageBuffer M:CoreMedia.CMSampleBuffer.GetSampleAttachments(System.Boolean) M:CoreMedia.CMSampleBuffer.GetSampleSize(System.IntPtr) M:CoreMedia.CMSampleBuffer.GetSampleTimingInfo -M:CoreMedia.CMSampleBuffer.GetSampleTimingInfo(System.IntPtr@) +M:CoreMedia.CMSampleBuffer.GetSampleTimingInfo(System.Int32@) M:CoreMedia.CMSampleBuffer.GetTypeID M:CoreMedia.CMSampleBuffer.GetVideoFormatDescription M:CoreMedia.CMSampleBuffer.Invalidate