diff --git a/src/Metal/MTLEnums.cs b/src/Metal/MTLEnums.cs index e9e5983ed571..2933c7a7ab25 100644 --- a/src/Metal/MTLEnums.cs +++ b/src/Metal/MTLEnums.cs @@ -971,14 +971,39 @@ public enum MTLPipelineOption : ulong { /// Enumerates the hardware feature sets that are available on a device. [Native] public enum MTLFeatureSet : ulong { +#if XAMCORE_5_0 + [NoMacCatalyst] +#elif __MACCATALYST__ + [Obsolete ("Not available on the current platform.")] +#endif [NoTV, NoMac] iOS_GPUFamily1_v1 = 0, +#if XAMCORE_5_0 + [NoMacCatalyst] +#elif __MACCATALYST__ + [Obsolete ("Not available on the current platform.")] +#endif [NoTV, NoMac] iOS_GPUFamily1_v2 = 2, +#if XAMCORE_5_0 + [NoMacCatalyst] +#elif __MACCATALYST__ + [Obsolete ("Not available on the current platform.")] +#endif [NoTV, NoMac] iOS_GPUFamily2_v1 = 1, +#if XAMCORE_5_0 + [NoMacCatalyst] +#elif __MACCATALYST__ + [Obsolete ("Not available on the current platform.")] +#endif [NoTV, NoMac] iOS_GPUFamily2_v2 = 3, +#if XAMCORE_5_0 + [NoMacCatalyst] +#elif __MACCATALYST__ + [Obsolete ("Not available on the current platform.")] +#endif [NoTV, NoMac] iOS_GPUFamily3_v1 = 4, [NoTV, NoMac, NoMacCatalyst] @@ -1010,29 +1035,14 @@ public enum MTLFeatureSet : ulong { [NoiOS, NoTV, NoMacCatalyst] macOS_GPUFamily1_v1 = 10000, -#if !NET - [Obsolete ("Use 'macOS_GPUFamily1_v1' instead.")] - OSX_GPUFamily1_v1 = macOS_GPUFamily1_v1, -#endif - [NoiOS, NoTV] [NoMacCatalyst] macOS_GPUFamily1_v2 = 10001, -#if !NET - [Obsolete ("Use 'macOS_GPUFamily1_v2' instead.")] - OSX_GPUFamily1_v2 = macOS_GPUFamily1_v2, -#endif - [NoiOS, NoTV] [NoMacCatalyst] macOS_ReadWriteTextureTier2 = 10002, -#if !NET - [Obsolete ("Use 'macOS_ReadWriteTextureTier2' instead.")] - OSX_ReadWriteTextureTier2 = macOS_ReadWriteTextureTier2, -#endif - [NoiOS, NoTV] [NoMacCatalyst] macOS_GPUFamily1_v3 = 10003, @@ -1045,9 +1055,10 @@ public enum MTLFeatureSet : ulong { [NoMacCatalyst] macOS_GPUFamily2_v1 = 10005, -#if !NET - [Obsolete ("Use 'tvOS_GPUFamily1_v1' instead.")] - TVOS_GPUFamily1_v1 = 30000, +#if XAMCORE_5_0 + [NoMacCatalyst] +#elif __MACCATALYST__ + [Obsolete ("Not available on the current platform.")] #endif [NoiOS, NoMac] diff --git a/src/oslog.cs b/src/oslog.cs index b86ea56f30a7..5b7c09976f60 100644 --- a/src/oslog.cs +++ b/src/oslog.cs @@ -64,6 +64,12 @@ enum OSLogMessageComponentArgumentCategory : long { [TV (15, 0), iOS (15, 0), MacCatalyst (15, 0)] [Native] enum OSLogStoreScope : long { +#if XAMCORE_5_0 + [NoTV, NoiOS, NoMacCatalyst] +#endif +#if !MONOMAC + [Obsolete ("Not available on the current platform.")] +#endif System = 0, CurrentProcessIdentifier = 1, } diff --git a/tests/cecil-tests/AttributeTest.cs b/tests/cecil-tests/AttributeTest.cs index 85e0678eb54f..23d791dc0619 100644 --- a/tests/cecil-tests/AttributeTest.cs +++ b/tests/cecil-tests/AttributeTest.cs @@ -193,10 +193,6 @@ public void FindSupportedOnElementsThatDoNotExistInThatAssembly () continue; } foreach (var member in GetAllTypeMembers (type)) { - // If a member is hidden, it's probably because it's broken in some way, so don't consider it. - if (ObsoleteTest.HasEditorBrowseableNeverAttribute (member)) - continue; - var mentionedPlatforms = GetAvailabilityAttributes (member).ToList (); if (mentionedPlatforms.Any ()) { var claimedPlatforms = GetSupportedAvailabilityAttributes (member).ToList (); diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index 93c3b9785799..0a10b3d85fa8 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -16865,7 +16865,6 @@ F:OSLog.OSLogMessageComponentArgumentCategory.String F:OSLog.OSLogMessageComponentArgumentCategory.UInt64 F:OSLog.OSLogMessageComponentArgumentCategory.Undefined F:OSLog.OSLogStoreScope.CurrentProcessIdentifier -F:OSLog.OSLogStoreScope.System F:PassKit.PKAddPassButtonStyle.Black F:PassKit.PKAddPassButtonStyle.Outline F:PassKit.PKAddPaymentPassError.SystemCancelled diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.ignore b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.ignore deleted file mode 100644 index 4dc5421d375b..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-Metal.ignore +++ /dev/null @@ -1,6 +0,0 @@ -!extra-enum-value! Managed value 0 for MTLFeatureSet.iOS_GPUFamily1_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 1 for MTLFeatureSet.iOS_GPUFamily2_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 2 for MTLFeatureSet.iOS_GPUFamily1_v2 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 3 for MTLFeatureSet.iOS_GPUFamily2_v2 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 30000 for MTLFeatureSet.tvOS_GPUFamily1_v1 is available for the current platform while the value in the native header is not -!extra-enum-value! Managed value 4 for MTLFeatureSet.iOS_GPUFamily3_v1 is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-OSLog.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-OSLog.todo deleted file mode 100644 index bc0bdcfbec57..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-OSLog.todo +++ /dev/null @@ -1 +0,0 @@ -!extra-enum-value! Managed value 0 for OSLogStoreScope.System is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-OSLog.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-OSLog.todo deleted file mode 100644 index bc0bdcfbec57..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-OSLog.todo +++ /dev/null @@ -1 +0,0 @@ -!extra-enum-value! Managed value 0 for OSLogStoreScope.System is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreMIDI.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreMIDI.ignore index 20bfae56def7..e0e99129c1d0 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreMIDI.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreMIDI.ignore @@ -31,8 +31,6 @@ !missing-pinvoke! MIDISendEventList is not bound !missing-pinvoke! MIDISourceCreateWithProtocol is not bound -# header's clearly say this enum value is not supported on macOS, yet xtro claims it is -!missing-enum-value! MidiNotificationMessageId native value kMIDIMsgInternalStart = 4096 not bound !missing-pinvoke! MIDIEventPacketSysexBytesForGroup is not bound !missing-pinvoke! MIDISendUMPSysex is not bound !missing-pinvoke! MIDISendUMPSysex8 is not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-MapKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-MapKit.ignore deleted file mode 100644 index 68ffaa04db33..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-MapKit.ignore +++ /dev/null @@ -1 +0,0 @@ -!missing-enum-value! MKUserTrackingMode native value MKUserTrackingModeFollowWithHeading = 2 not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-MapKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-MapKit.ignore deleted file mode 100644 index 68ffaa04db33..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-MapKit.ignore +++ /dev/null @@ -1 +0,0 @@ -!missing-enum-value! MKUserTrackingMode native value MKUserTrackingModeFollowWithHeading = 2 not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-OSLog.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-OSLog.todo deleted file mode 100644 index bc0bdcfbec57..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-OSLog.todo +++ /dev/null @@ -1 +0,0 @@ -!extra-enum-value! Managed value 0 for OSLogStoreScope.System is available for the current platform while the value in the native header is not diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore index 6ed315a0cbea..b1305516ab9e 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UIKit.ignore @@ -322,9 +322,6 @@ ## Enums not needed on tvOS !missing-enum! UIListSeparatorVisibility not bound !missing-enum! UIPrintRenderingQuality not bound -!missing-enum-value! UICollectionLayoutListAppearance native value UICollectionLayoutListAppearanceInsetGrouped = 2 not bound -!missing-enum-value! UICollectionLayoutListAppearance native value UICollectionLayoutListAppearanceSidebar = 3 not bound -!missing-enum-value! UICollectionLayoutListAppearance native value UICollectionLayoutListAppearanceSidebarPlain = 4 not bound # Not binding for now, does not make sense on tvOS !missing-selector! +UITextInputContext::current not bound diff --git a/tests/xtro-sharpie/xtro-sharpie/EnumCheck.cs b/tests/xtro-sharpie/xtro-sharpie/EnumCheck.cs index 7859ab461ff8..874928b40c07 100644 --- a/tests/xtro-sharpie/xtro-sharpie/EnumCheck.cs +++ b/tests/xtro-sharpie/xtro-sharpie/EnumCheck.cs @@ -244,8 +244,12 @@ public override void VisitEnumDecl (EnumDecl decl, VisitKind visitKind) // couldn't find a matching managed enum value for the native enum value // don't report deprecated native enum values (or if the native enum itself is deprecated) as missing - if (!valueDecl.IsDeprecated () && !decl.IsDeprecated ()) + if (!valueDecl.IsDeprecated () && !decl.IsDeprecated ()) { + // skip native enum values that aren't available on the current platform, unless it's an error enum. + if (!valueDecl.IsAvailable () && !IsErrorEnum (mname)) + continue; Log.On (framework).Add ($"!missing-enum-value! {type.Name} native value {valueName} = {value} not bound"); + } } } @@ -280,14 +284,21 @@ public override void VisitEnumDecl (EnumDecl decl, VisitKind visitKind) Log.On (framework).Add ($"!wrong-enum-size! {name} managed {managed_size} vs native {native_size}"); } + static bool IsErrorEnum (string typeName) + { + if (typeName.EndsWith ("Error", StringComparison.Ordinal)) + return true; + if (typeName.EndsWith ("ErrorCode", StringComparison.Ordinal)) + return true; + return false; + } + static bool IsErrorEnum (TypeDefinition type) { if (!type.IsEnum) return false; - if (type.Name.EndsWith ("Error", StringComparison.Ordinal)) - return true; - if (type.Name.EndsWith ("ErrorCode", StringComparison.Ordinal)) + if (IsErrorEnum (type.Name)) return true; if (!type.HasCustomAttributes)