Cleanup __builtin_available where platform is now guaranteed on Apple platforms#122789
Merged
vcsjones merged 2 commits intodotnet:mainfrom Jan 17, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes unnecessary runtime platform version checks (__builtin_available) that are no longer needed now that the minimum supported Apple platform versions have been raised to macOS 12 and iOS/tvOS 13. This simplifies the code by eliminating conditional compilation paths for older platform versions that are no longer supported.
Key changes:
- Removes fallback code paths for older OS versions
- Unconditionally uses newer platform APIs that are now guaranteed to be available
- Simplifies control flow in several native implementation files
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/minipal/memorybarrierprocesswide.c | Removes macOS 10.14/iOS 12/tvOS 9 check and fallback thread state implementation, now always uses thread_get_register_pointer_values |
| src/native/libs/System.Security.Cryptography.Native.Apple/pal_sec.c | Removes iOS 11.3/tvOS 11.3 check, now always uses SecCopyErrorMessageString instead of fallback formatting |
| src/native/libs/System.Security.Cryptography.Native.Apple/pal_rsa.c | Removes macOS 10.15/iOS 13/tvOS 13 check, now always adds kSecUseDataProtectionKeychain to RSA key attributes |
| src/native/libs/System.Security.Cryptography.Native.Apple/pal_ecc.c | Removes macOS 10.15/iOS 13/tvOS 13 check, now always adds kSecUseDataProtectionKeychain to ECC key attributes |
| src/mono/mono/utils/mono-mmap.c | Removes macOS 11 check, now unconditionally sets MAP_JIT flag on ARM64 (non-Catalyst) |
| src/mono/mono/utils/mono-codeman.c | Removes macOS 11 checks in both mono_codeman_enable_write and mono_codeman_disable_write, now unconditionally manages JIT write protection |
bartonjs
approved these changes
Jan 15, 2026
steveisok
approved these changes
Jan 15, 2026
rosebyte
pushed a commit
that referenced
this pull request
Jan 19, 2026
… platforms (#122789) We had a couple of places that were using `__builtin_available` to guard against some platform version features. Now that our Apple platform floor is macOS 12 and iOS/tvOS 13, we can remove some of them. Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We had a couple of places that were using
__builtin_availableto guard against some platform version features. Now that our Apple platform floor is macOS 12 and iOS/tvOS 13, we can remove some of them.