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.
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
Added target_os cfg feature to header translator #433
base: master
Are you sure you want to change the base?
Added target_os cfg feature to header translator #433
Changes from all commits
fabf5ed
7de510b
615c4de
429ac57
3db4f6c
57d3bd7
39ce7d5
e04eaa8
cce841a
747216d
ae84ab9
5fb969e
f9d3d4f
492e0a8
7edae2c
61d1aa7
13a8a32
4b34fd4
677ae87
0df1d04
fb2265a
9bd8ab3
dbe1782
f1791dc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I know that the headers expose this as "unavailability", but I think it would look nicer in the docs if it was inverted; e.g. that
#[cfg(not(any(target_os = "watchos")))]
became#[cfg(any(target_os = "tvos", target_os = "ios", target_os = "macos"))]
instead (this is also how Apple's own docs does it).This interferes with GNUStep of course, but perhaps we can just code in a manual override there for all of
AppKit
andFoundation
for now?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.
I actually spent a little bit of time doing both variants -
all(not(target_os = "ios"), any(taget_os = "macos", target_os = "tvos", target_os = "watchos"))
. I didn't like it as then everything had a cfg attribute.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.
Yeah, I agree with that part
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.
#[deprecated]
now also appears onimpl ClassType
, which is incorrect.So perhaps we should split out the
Unavailable
fromAvailability
(and maybe rename it toPlatformCfg
)? Since that part is always going to be acfg
-gate, which has interactions with higher-levelcfg
-gates (and must propagate to imports likegenerated/[Framework]/mod.rs
), whileintroduced
anddeprecated
will always only need to apply to the statement/method/field they're associated with.Maybe it would even make sense to add
PlatformCfg
as a field ofItemIdentifier
? Since these two are access so often together.