Skip to content

Commit

Permalink
Rollup merge of #125225 - madsmtm:ios-crt_externs.h, r=workingjubilee
Browse files Browse the repository at this point in the history
Use functions from `crt_externs.h` on iOS/tvOS/watchOS/visionOS

Use `_NSGetEnviron`, `_NSGetArgc` and `_NSGetArgv` on iOS/tvOS/watchOS/visionOS, see each commit and the code comments for details. This allows us to unify more code with the macOS implementation, as well as avoiding linking to the `Foundation` framework (which is good for startup performance).

The biggest problem with doing this would be if it lead to App Store rejections. After doing a bunch of research on this, while [it did happen once in 2009](https://blog.unity.com/engine-platform/unity-app-store-submissions-problem-solved), I find it fairly unlikely to happen nowadays, especially considering that Apple has later _added_ `crt_externs.h` to the iOS/tvOS/watchOS/visionOS SDKs, strongly signifying the functions therein is indeed supported on those platforms (even though they lack an availability attribute).

That we've been overly cautious here has also been noted by `@thomcc` in rust-lang/rust#117910 (comment).

r? `@workingjubilee`

`@rustbot` label O-apple
  • Loading branch information
matthiaskrgr authored May 21, 2024
2 parents 2f47aa2 + 004560d commit 39b3e33
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 39b3e33

Please sign in to comment.