};
use super::backtrace::EvalContextExt as _;
-use crate::helpers::convert::Truncate;
+use crate::helpers::{convert::Truncate, target_os_is_unix};
use crate::*;
/// Returned by `emulate_foreign_item_by_name`.
// Platform-specific shims
_ => match this.tcx.sess.target.os.as_ref() {
- "linux" | "macos" => return shims::unix::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, abi, args, dest, ret),
+ target if target_os_is_unix(target) => return shims::unix::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, abi, args, dest, ret),
"windows" => return shims::windows::foreign_items::EvalContextExt::emulate_foreign_item_by_name(this, link_name, abi, args, dest, ret),
target => throw_unsup_format!("the target `{}` is not supported", target),
}