| 1 |
//! A default sys.rs for unrecognized targets. |
| 2 |
//! |
| 3 |
//! If lib.rs doesn't recognize the target, it defaults to using this file, |
| 4 |
//! which issues an explanatory compile error. |
| 5 |
|
| 6 |
// If there is no OS, there's no `errno` or equivalent defined. |
| 7 |
#[cfg(any(target_os = "unknown", target_os = "none"))] |
| 8 |
compile_error!("The target OS is \"unknown\" or \"none\", so it's unsupported by the errno crate."); |
| 9 |
|
| 10 |
// If there is an OS, support may be added. |
| 11 |
#[cfg(not(any(target_os = "unknown", target_os = "none")))] |
| 12 |
compile_error!("The target OS is not yet supported in the errno crate."); |
| 13 |
|
| 14 |
// The following define the functions of the normal implementations |
| 15 |
// so that the user doesn't see uninteresting errors after the |
| 16 |
// errors above. |
| 17 |
|
| 18 |
use crate::Errno; |
| 19 |
|
| 20 |
pub fn with_description<F, T>(_err: Errno, _callback: F) -> T |
| 21 |
where |
| 22 |
F: FnOnce(Result<&str, Errno>) -> T, |
| 23 |
{ |
| 24 |
unreachable!() |
| 25 |
} |
| 26 |
|
| 27 |
pub const STRERROR_NAME: &str = ""; |
| 28 |
|
| 29 |
pub fn errno() -> Errno { |
| 30 |
unreachable!() |
| 31 |
} |
| 32 |
|
| 33 |
pub fn set_errno(_: Errno) { |
| 34 |
unreachable!() |
| 35 |
} |