-
Notifications
You must be signed in to change notification settings - Fork 516
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
[CoreFoundation] Add support for xcode 13 beta 5. #12552
Merged
mandel-macaque
merged 3 commits into
xamarin:main
from
mandel-macaque:corefoundation-xcode13-beta5
Aug 27, 2021
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
// | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Runtime.Versioning; | ||
|
||
using ObjCRuntime; | ||
using CoreFoundation; | ||
|
@@ -603,13 +604,23 @@ public CFBundle.Architecture[] Architectures { | |
} | ||
} | ||
|
||
#if MONOMAC | ||
#if MONOMAC || __MACCATALYST__ | ||
#if !NET | ||
[Introduced (PlatformName.MacOSX, 11, 0)] | ||
[MacCatalyst (15,0)] | ||
#else | ||
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), SupportedOSPlatform ("macos11.0"), SupportedOSPlatform ("maccatalyst15.0")] | ||
#endif | ||
[DllImport (Constants.CoreFoundationLibrary)] | ||
[return: MarshalAs (UnmanagedType.I1)] | ||
extern static bool CFBundleIsExecutableLoadable (IntPtr bundle); | ||
|
||
#if !NET | ||
[Introduced (PlatformName.MacOSX, 11, 0)] | ||
[MacCatalyst (15,0)] | ||
#else | ||
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), SupportedOSPlatform ("macos11.0"), SupportedOSPlatform ("maccatalyst15.0")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fine here (public) |
||
#endif | ||
public static bool IsExecutableLoadable (CFBundle bundle) | ||
{ | ||
if (bundle == null) | ||
|
@@ -620,12 +631,22 @@ public static bool IsExecutableLoadable (CFBundle bundle) | |
return CFBundleIsExecutableLoadable (bundle.Handle); | ||
} | ||
|
||
#if !NET | ||
[Introduced (PlatformName.MacOSX, 11, 0)] | ||
[MacCatalyst (15,0)] | ||
#else | ||
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), SupportedOSPlatform ("macos11.0"), SupportedOSPlatform ("maccatalyst15.0")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not here (private) |
||
#endif | ||
[DllImport (Constants.CoreFoundationLibrary)] | ||
[return: MarshalAs (UnmanagedType.I1)] | ||
extern static bool CFBundleIsExecutableLoadableForURL (IntPtr bundle); | ||
|
||
#if !NET | ||
[Introduced (PlatformName.MacOSX, 11, 0)] | ||
[MacCatalyst (15,0)] | ||
#else | ||
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), SupportedOSPlatform ("macos11.0"), SupportedOSPlatform ("maccatalyst15.0")] | ||
#endif | ||
public static bool IsExecutableLoadable (NSUrl url) | ||
{ | ||
if (url == null) | ||
|
@@ -634,12 +655,22 @@ public static bool IsExecutableLoadable (NSUrl url) | |
return CFBundleIsExecutableLoadableForURL (url.Handle); | ||
} | ||
|
||
#if !NET | ||
[Introduced (PlatformName.MacOSX, 11, 0)] | ||
[MacCatalyst (15,0)] | ||
#else | ||
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), SupportedOSPlatform ("macos11.0"), SupportedOSPlatform ("maccatalyst15.0")] | ||
#endif | ||
[DllImport (Constants.CoreFoundationLibrary)] | ||
[return: MarshalAs (UnmanagedType.I1)] | ||
extern static bool CFBundleIsArchitectureLoadable (/*cpu_type_t => integer_t => int*/ Architecture architecture); | ||
|
||
#if !NET | ||
[Introduced (PlatformName.MacOSX, 11, 0)] | ||
[MacCatalyst (15,0)] | ||
#else | ||
[UnsupportedOSPlatform ("ios"), UnsupportedOSPlatform ("tvos"), SupportedOSPlatform ("macos11.0"), SupportedOSPlatform ("maccatalyst15.0")] | ||
#endif | ||
public static bool IsArchitectureLoadable (Architecture architecture) => CFBundleIsArchitectureLoadable (architecture); | ||
|
||
#endif | ||
|
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
That code is not complied for iOS or tvOS so
UnsupportedOSPlatform
is not helpful on aprivate
member.On a public member is has some value (documentation), e.g. you doing Mac work but you'll notice your API won't be available if the code eventually needs to be used on iOS.
However on a private member it's only useful to have availability because it helps introspection to detect mistakes. That code won't be present for (example) iOS so introspection won't be using it. So this is only extraneous metadata.
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.
Should I be doing something similar for the ones that I am doing?