Skip to content

Commit

Permalink
Merge branch 'main' into iad-removal
Browse files Browse the repository at this point in the history
  • Loading branch information
spouliot committed Jun 14, 2021
2 parents 4bd72e7 + 51f0651 commit 93fe589
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 33 deletions.
27 changes: 27 additions & 0 deletions src/CloudKit/CKCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#if !COREBUILD

using System;
using System.Runtime.Versioning;
using System.Threading.Tasks;

#if MONOMAC || IOS
Expand Down Expand Up @@ -137,6 +138,32 @@ public partial class CKDiscoveredUserInfo {
[iOS (9,0)][Mac (10,11)]
[Obsolete ("Empty stub (not public API).")]
public virtual CNContact DisplayContact { get; }

#if NET
[UnsupportedOSPlatform ("ios15.0")]
[UnsupportedOSPlatform ("macos12.0")]
#else
[Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'DisplayContact.GivenName'.")]
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'DisplayContact.GivenName'.")]
[Obsoleted (PlatformName.MacOSX, 12, 0, message : "Use 'DisplayContact.GivenName'.")]
[Obsoleted (PlatformName.iOS, 15, 0, message : "Use 'DisplayContact.GivenName'.")]
#endif
public virtual string FirstName {
get { return null; }
}

#if NET
[UnsupportedOSPlatform ("ios15.0")]
[UnsupportedOSPlatform ("macos12.0")]
#else
[Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'DisplayContact.FamilyName'.")]
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'DisplayContact.FamilyName'.")]
[Obsoleted (PlatformName.MacOSX, 12, 0, message : "Use 'DisplayContact.GivenName'.")]
[Obsoleted (PlatformName.iOS, 15, 0, message : "Use 'DisplayContact.GivenName'.")]
#endif
public virtual string LastName {
get { return null; }
}
}
#endif

Expand Down
6 changes: 6 additions & 0 deletions src/CoreMidi/MidiCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ namespace CoreMidi {

public partial class MidiCISession {

[Obsolete ("Always throws 'NotSupportedException' (not a public API).")]
public MidiCISession (uint entity, Action handler)
{
throw new NotSupportedException ();
}

[Obsolete ("Always throws 'NotSupportedException' (not a public API).")]
public virtual void GetProperty (NSData inquiry, byte channel, MidiCIPropertyResponseHandler handler)
=> throw new NotSupportedException ();
Expand Down
31 changes: 18 additions & 13 deletions src/ObjCRuntime/Selector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,33 @@ public partial class Selector : IEquatable<Selector>, INativeObject {
internal const string Release = "release";
internal const string Retain = "retain";
internal const string Autorelease = "autorelease";
internal const string Dealloc = "dealloc";
internal const string DoesNotRecognizeSelector = "doesNotRecognizeSelector:";
internal const string PerformSelectorOnMainThreadWithObjectWaitUntilDone = "performSelectorOnMainThread:withObject:waitUntilDone:";
internal const string PerformSelectorInBackground = "performSelectorInBackground:withObject:";
#if MONOMAC
internal const string DoesNotRecognizeSelector = "doesNotRecognizeSelector:";
internal const string PerformSelectorWithObjectAfterDelay = "performSelector:withObject:afterDelay:";
#endif

IntPtr handle;
string name;

public Selector (IntPtr sel)
: this (sel, true)
{
}

internal unsafe Selector (IntPtr sel, bool check)
{
if (check && !sel_isMapped (sel))
throw new ArgumentException ("sel is not a selector handle.");
if (!sel_isMapped (sel))
ObjCRuntime.ThrowHelper.ThrowArgumentException (nameof (sel), "Not a selector handle.");

this.handle = sel;
name = GetName (sel);
}

// this .ctor is required, like for any INativeObject implementation
// even if selectors are not disposable
[Preserve (Conditional = true)]
internal Selector (IntPtr handle, bool /* unused */ owns)
{
this.handle = handle;
name = GetName (handle);
}

public Selector (string name)
{
this.name = name;
Expand All @@ -75,12 +79,13 @@ public string Name {
}

public static bool operator== (Selector left, Selector right) {
if (((object)left) == null)
return (((object)right) == null);
if (((object)right) == null)
if (left is null)
return (right is null);
if (right is null)
return false;

// note: there's a sel_isEqual function but it's safe to compare pointers
// ref: https://opensource.apple.com/source/objc4/objc4-551.1/runtime/objc-sel.mm.auto.html
return left.handle == right.handle;
}

Expand Down
13 changes: 0 additions & 13 deletions src/cloudkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,19 +430,6 @@ interface CKDiscoveredUserInfo : NSCoding, NSCopying, NSSecureCoding {
[NullAllowed]
[Export ("userRecordID", ArgumentSemantic.Copy)]
CKRecordID UserRecordId { get; }

[Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'DisplayContact.GivenName'.")]
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'DisplayContact.GivenName'.")]
[NullAllowed]
[Export ("firstName", ArgumentSemantic.Copy)]
string FirstName { get; }

[Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'DisplayContact.FamilyName'.")]
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'DisplayContact.FamilyName'.")]
[NullAllowed]
[Export ("lastName", ArgumentSemantic.Copy)]
string LastName { get; }

}

// CKError.h Fields
Expand Down
3 changes: 0 additions & 3 deletions src/coremidi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ interface MidiCIProfileState : NSSecureCoding
[DisableDefaultCtor]
interface MidiCISession
{
[Export ("initWithMIDIEntity:dataReadyHandler:")]
IntPtr Constructor (uint entity, Action handler);

[Export ("entity")]
uint Entity { get; }

Expand Down
8 changes: 7 additions & 1 deletion src/mlcompute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,13 @@ interface MLCTensor : NSCopying {
MLCDevice Device { get; }

[Export ("optimizerData", ArgumentSemantic.Copy)]
MLCTensorData[] OptimizerData { get; set; }
MLCTensorData[] OptimizerData {
get;
#if !XAMCORE_4_0
[NotImplemented]
set;
#endif
}

[Export ("optimizerDeviceData", ArgumentSemantic.Copy)]
MLCTensorOptimizerDeviceData[] OptimizerDeviceData { get; }
Expand Down
7 changes: 6 additions & 1 deletion src/networkextension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,12 @@ interface NEFilterSocketFlow {
NWEndpoint LocalEndpoint { get; }

[Export ("socketFamily")]
int SocketFamily { get; set; }
int SocketFamily {
get;
#if !XAMCORE_4_0
[NotImplemented] set;
#endif
}

[Export ("socketType")]
int SocketType {
Expand Down
12 changes: 10 additions & 2 deletions src/vision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,13 @@ interface VNImageAlignmentObservation {
interface VNImageTranslationAlignmentObservation {

[Export ("alignmentTransform", ArgumentSemantic.Assign)]
CGAffineTransform AlignmentTransform { get; set; }
CGAffineTransform AlignmentTransform {
get;
#if !XAMCORE_4_0
[NotImplemented]
set;
#endif
}
}

[TV (11,0), Mac (10,13), iOS (11,0)]
Expand All @@ -1719,8 +1725,10 @@ interface VNImageHomographicAlignmentObservation {
Matrix3 WarpTransform {
[MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]
get;
[MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")]
#if !XAMCORE_4_0
[NotImplemented]
set;
#endif
}
}

Expand Down
1 change: 1 addition & 0 deletions tests/dotnet/UnitTests/ProjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void Clean (string project_path)
[TestCase ("iossimulator-x86")]
[TestCase ("iossimulator-x64")]
[TestCase ("ios-arm64")]
[TestCase ("ios-arm")]
public void BuildMySingleView (string runtimeIdentifier)
{
var platform = ApplePlatform.iOS;
Expand Down

0 comments on commit 93fe589

Please sign in to comment.