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

Enable most macos functions on all of apple_targets #2238

Closed
asomers opened this issue Nov 30, 2023 · 2 comments · Fixed by #2241
Closed

Enable most macos functions on all of apple_targets #2238

asomers opened this issue Nov 30, 2023 · 2 comments · Fixed by #2241

Comments

@asomers
Copy link
Member

asomers commented Nov 30, 2023

A quick search through libc shows that there's only one function we use that's defined on macos but isn't defined on tvos, watchos, and ios as well: clock_settime. Even that, I suspect, is a mistake, given that clock_gettime is defined for all of them.
We should replace #[cfg(target_os = macos)] with #[cfg(apple_targets)] everywhere.
Honestly, I don't know why Apple needs so many different Rust targets.

@SteveLauC
Copy link
Member

SteveLauC commented Dec 1, 2023

From this PR Add tvOS and watchOS support, identical to iOS support, iOS, tvOS, and watchOS are the same thing, though I have no idea how we can test whether clock_settime is available on iOS, libc does not have a CI for it

@SteveLauC SteveLauC changed the title Enable most macos functions on all of apple_family Enable most macos functions on all of apple_targets Dec 1, 2023
@SteveLauC
Copy link
Member

SteveLauC commented Dec 1, 2023

Well, it seems that this symbol is not available on iOS/tvOS/watchOS, from the PR that added it for macOS:

Looking at time.h for macOS 11.5 clock_settime still doesn't seem to be exported for iOS. Declaring it only for macOS (using rust-lang/libc#2208 as an example of how).

And I checked the apple's latest libc(Libc-1534.40.2), still, no support for iOS/tvOS/watchOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants