Skip to content
New issue

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

[CFNetwork] Add Xcode13 beta 1 support. #11966

Merged
merged 4 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/CFNetwork/CFHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ namespace CFNetwork {
namespace CoreServices {
#endif

// used by CFStream.cs (only?)
[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
class CFHost : INativeObject, IDisposable {
internal IntPtr handle;

Expand Down
40 changes: 40 additions & 0 deletions src/CoreFoundation/CFStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,20 @@ public abstract class CFStream : CFType, INativeObject, IDisposable {

#region Stream Constructors

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
[DllImport (Constants.CoreFoundationLibrary)]
internal extern static void CFStreamCreatePairWithSocket (/* CFAllocatorRef */ IntPtr allocator, CFSocketNativeHandle sock,
/* CFReadStreamRef* */ out IntPtr readStream, /* CFWriteStreamRef* */ out IntPtr writeStream);

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
public static void CreatePairWithSocket (CFSocket socket, out CFReadStream readStream,
out CFWriteStream writeStream)
{
Expand All @@ -175,11 +185,21 @@ public static void CreatePairWithSocket (CFSocket socket, out CFReadStream readS
writeStream = new CFWriteStream (write);
}

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
[DllImport (Constants.CFNetworkLibrary)]
internal extern static void CFStreamCreatePairWithPeerSocketSignature (/* CFAllocatorRef */ IntPtr allocator,
/* CFSocketSignature* */ ref CFSocketSignature sig,
/* CFReadStreamRef* */ out IntPtr readStream, /* CFWriteStreamRef* */ out IntPtr writeStream);

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
public static void CreatePairWithPeerSocketSignature (AddressFamily family, SocketType type,
ProtocolType proto, IPEndPoint endpoint,
out CFReadStream readStream,
Expand All @@ -196,13 +216,23 @@ public static void CreatePairWithPeerSocketSignature (AddressFamily family, Sock

#if !WATCH
// CFSocketStream.h in CFNetwork.framework (not CoreFoundation)
[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
[DllImport (Constants.CFNetworkLibrary)]
internal extern static void CFStreamCreatePairWithSocketToCFHost (
/* CFAllocatorRef __nullable */ IntPtr allocator,
/* CFHostRef __nonnull */ IntPtr host, /* SInt32 */ int port,
/* CFReadStreamRef __nullable * __nullable */ out IntPtr readStream,
/* CFWriteStreamRef __nullable * __nullable */ out IntPtr writeStream);

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
public static void CreatePairWithSocketToHost (IPEndPoint endpoint,
out CFReadStream readStream,
out CFWriteStream writeStream)
Expand All @@ -217,11 +247,21 @@ public static void CreatePairWithSocketToHost (IPEndPoint endpoint,
}
#endif

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
[DllImport (Constants.CFNetworkLibrary)]
internal extern static void CFStreamCreatePairWithSocketToHost (/* CFAllocatorRef */ IntPtr allocator,
/* CFStringRef */ IntPtr host, /* UInt32 */ int port,
/* CFReadStreamRef* */ out IntPtr readStream, /* CFWriteStreamRef* */ out IntPtr writeStream);

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
public static void CreatePairWithSocketToHost (string host, int port,
out CFReadStream readStream,
out CFWriteStream writeStream)
Expand Down
3 changes: 3 additions & 0 deletions src/ObjCRuntime/ObsoleteConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ partial class Constants {

internal const string UseCallKitInstead = "Use the 'CallKit' API instead.";

internal const string UseNetworkInstead = "Use 'Network.framework' instead.";

internal const string WatchKitRemoved = "The WatchKit framework has been removed from iOS.";

internal const string UnavailableOniOS = "This type is not available on iOS.";
Expand All @@ -18,5 +20,6 @@ partial class Constants {
internal const string MacOS32bitsUnavailable = "This framework is not available on 64bits macOS versions.";

internal const string iAdRemoved = "The iAd framework has been removed from iOS.";

}
}
56 changes: 28 additions & 28 deletions src/Security/SecureTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ public enum SslStatus {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslSessionOption {
BreakOnServerAuth,
BreakOnCertRequested,
Expand Down Expand Up @@ -197,10 +197,10 @@ public enum SslSessionOption {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslAuthenticate {
Never,
Always,
Expand All @@ -209,32 +209,32 @@ public enum SslAuthenticate {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslProtocolSide {
Server,
Client,
}

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslConnectionType {
Stream,
Datagram
}

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslSessionState {
Invalid = -1,
Idle,
Expand All @@ -246,10 +246,10 @@ public enum SslSessionState {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslSessionStrengthPolicy {
Default,
ATSv1,
Expand All @@ -258,10 +258,10 @@ public enum SslSessionStrengthPolicy {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslClientCertificateState {
None,
Requested,
Expand Down
10 changes: 5 additions & 5 deletions src/Security/SslConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ namespace Security {

delegate SslStatus SslWriteFunc (IntPtr connection, IntPtr data, /* size_t* */ ref nint dataLength);

[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public abstract class SslConnection : IDisposable {

GCHandle handle;
Expand Down Expand Up @@ -121,4 +121,4 @@ public unsafe override SslStatus Write (IntPtr data, ref nint dataLength)
return SslStatus.Success;
}
}
}
}
5 changes: 0 additions & 5 deletions tests/xtro-sharpie/MacCatalyst-CoreFoundation.todo
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,3 @@
!missing-pinvoke! CFUserNotificationGetTypeID is not bound
!missing-pinvoke! CFUserNotificationReceiveResponse is not bound
!missing-pinvoke! CFUserNotificationUpdate is not bound
## appended from unclassified file
!deprecated-attribute-missing! CFStreamCreatePairWithPeerSocketSignature missing a [Deprecated] attribute
!deprecated-attribute-missing! CFStreamCreatePairWithSocket missing a [Deprecated] attribute
!deprecated-attribute-missing! CFStreamCreatePairWithSocketToCFHost missing a [Deprecated] attribute
!deprecated-attribute-missing! CFStreamCreatePairWithSocketToHost missing a [Deprecated] attribute
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/MacCatalyst-CoreServices.todo

This file was deleted.

4 changes: 0 additions & 4 deletions tests/xtro-sharpie/iOS-CoreFoundation.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/iOS-CoreServices.todo

This file was deleted.

4 changes: 0 additions & 4 deletions tests/xtro-sharpie/macOS-CoreFoundation.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/macOS-CoreServices.todo
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
!deprecated-attribute-missing! CFHostCreateWithAddress missing a [Deprecated] attribute
!deprecated-attribute-missing! CFHostCreateWithName missing a [Deprecated] attribute
!deprecated-attribute-missing! LSCopyAllRoleHandlersForContentType missing a [Deprecated] attribute
!deprecated-attribute-missing! LSCopyApplicationURLsForBundleIdentifier missing a [Deprecated] attribute
!deprecated-attribute-missing! LSCopyApplicationURLsForURL missing a [Deprecated] attribute
Expand Down
4 changes: 0 additions & 4 deletions tests/xtro-sharpie/tvOS-CoreFoundation.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/tvOS-CoreServices.todo

This file was deleted.

3 changes: 0 additions & 3 deletions tests/xtro-sharpie/watchOS-CoreFoundation.todo

This file was deleted.