Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 19f68a2

Browse files
ian-h-chamberlainAzureMarker
authored andcommitted
Enable argv support for horizon OS
See Meziu#9
1 parent 06eae30 commit 19f68a2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

library/std/src/sys/unix/args.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ impl DoubleEndedIterator for Args {
6868
target_os = "l4re",
6969
target_os = "fuchsia",
7070
target_os = "redox",
71-
target_os = "vxworks"
71+
target_os = "vxworks",
72+
target_os = "horizon"
7273
))]
7374
mod imp {
7475
use super::Args;

library/std/src/sys/unix/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ pub mod thread_local_key;
4343
pub mod thread_parker;
4444
pub mod time;
4545

46-
#[cfg(any(target_os = "espidf", target_os = "horizon"))]
46+
#[cfg(target_os = "espidf")]
4747
pub fn init(argc: isize, argv: *const *const u8) {}
4848

49-
#[cfg(not(any(target_os = "espidf", target_os = "horizon")))]
49+
#[cfg(not(target_os = "espidf"))]
5050
// SAFETY: must be called only once during runtime initialization.
5151
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
5252
pub unsafe fn init(argc: isize, argv: *const *const u8) {
@@ -88,6 +88,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) {
8888
target_os = "ios",
8989
target_os = "redox",
9090
target_os = "l4re",
91+
target_os = "horizon",
9192
)))]
9293
'poll: {
9394
use crate::sys::os::errno;
@@ -131,6 +132,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) {
131132
target_os = "fuchsia",
132133
target_os = "vxworks",
133134
target_os = "l4re",
135+
target_os = "horizon",
134136
)))]
135137
{
136138
use crate::sys::os::errno;
@@ -149,7 +151,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8) {
149151
}
150152

151153
unsafe fn reset_sigpipe() {
152-
#[cfg(not(any(target_os = "emscripten", target_os = "fuchsia")))]
154+
#[cfg(not(any(target_os = "emscripten", target_os = "fuchsia", target_os = "horizon")))]
153155
rtassert!(signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR);
154156
}
155157
}

0 commit comments

Comments
 (0)