Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/uu/stdbuf/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use std::process::Command;
target_os = "android",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly"
))]
mod platform {
Expand Down
30 changes: 27 additions & 3 deletions src/uu/stdbuf/src/libstdbuf/src/libstdbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@ pub unsafe extern "C" fn __stdbuf_get_stdin() -> *mut FILE {
unsafe { __stdinp() }
}

#[cfg(not(any(target_os = "macos", target_os = "freebsd")))]
#[cfg(target_os = "openbsd")]
{
unsafe extern "C" {
static mut __stdin: *mut FILE;
}
unsafe { __stdin }
}

#[cfg(not(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd")))]
{
unsafe extern "C" {
static mut stdin: *mut FILE;
Expand All @@ -48,7 +56,15 @@ pub unsafe extern "C" fn __stdbuf_get_stdout() -> *mut FILE {
unsafe { __stdoutp() }
}

#[cfg(not(any(target_os = "macos", target_os = "freebsd")))]
#[cfg(target_os = "openbsd")]
{
unsafe extern "C" {
static mut __stdout: *mut FILE;
}
unsafe { __stdout }
}

#[cfg(not(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd")))]
{
unsafe extern "C" {
static mut stdout: *mut FILE;
Expand All @@ -69,7 +85,15 @@ pub unsafe extern "C" fn __stdbuf_get_stderr() -> *mut FILE {
unsafe { __stderrp() }
}

#[cfg(not(any(target_os = "macos", target_os = "freebsd")))]
#[cfg(target_os = "openbsd")]
{
unsafe extern "C" {
static mut __stderr: *mut FILE;
}
unsafe { __stderr }
}

#[cfg(not(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd")))]
{
unsafe extern "C" {
static mut stderr: *mut FILE;
Expand Down
3 changes: 3 additions & 0 deletions src/uu/stdbuf/src/stdbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mod options {
target_os = "android",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly"
)
))]
Expand Down Expand Up @@ -82,6 +83,7 @@ enum ProgramOptionsError {
target_os = "android",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly"
))]
fn preload_strings() -> UResult<(&'static str, &'static str)> {
Expand All @@ -98,6 +100,7 @@ fn preload_strings() -> UResult<(&'static str, &'static str)> {
target_os = "android",
target_os = "freebsd",
target_os = "netbsd",
target_os = "openbsd",
target_os = "dragonfly",
target_vendor = "apple"
)))]
Expand Down
Loading