rust/library/std
Matthias Krüger a8ee8d5086
Rollup merge of #125225 - madsmtm:ios-crt_externs.h, r=workingjubilee
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 https://github.com/rust-lang/rust/pull/117910#issuecomment-1903372350.

r? `@workingjubilee`

`@rustbot` label O-apple
2024-05-21 12:47:05 +02:00
..
benches also test parts of std 2024-04-07 10:05:57 +02:00
src Rollup merge of #125225 - madsmtm:ios-crt_externs.h, r=workingjubilee 2024-05-21 12:47:05 +02:00
tests Rename test for issue 21058 2024-05-05 10:47:12 -04:00
build.rs Support for visionOS 2024-03-18 20:45:45 -07:00
Cargo.toml Rollup merge of #125011 - diondokter:opt-for-size, r=Amanieu,kobzol 2024-05-21 12:47:04 +02:00