#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd"))]
pub const EAGAIN: i32 = -35;
#[cfg(not(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd")))]
pub const EAGAIN: i32 = -11;
pub const EOF: i32 = -541_478_725;
pub const ENOMEM: i32 = -12;
pub const EINVAL: i32 = -22;
#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd"))]
pub const ETIMEDOUT: i32 = -60;
#[cfg(windows)]
pub const ETIMEDOUT: i32 = -138; #[cfg(not(any(
windows,
target_os = "macos",
target_os = "freebsd",
target_os = "openbsd"
)))]
pub const ETIMEDOUT: i32 = -110;
#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd"))]
pub const ECONNREFUSED: i32 = -61;
#[cfg(windows)]
pub const ECONNREFUSED: i32 = -107; #[cfg(not(any(
windows,
target_os = "macos",
target_os = "freebsd",
target_os = "openbsd"
)))]
pub const ECONNREFUSED: i32 = -111;
#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd"))]
pub const EHOSTUNREACH: i32 = -65;
#[cfg(windows)]
pub const EHOSTUNREACH: i32 = -110; #[cfg(not(any(
windows,
target_os = "macos",
target_os = "freebsd",
target_os = "openbsd"
)))]
pub const EHOSTUNREACH: i32 = -113;
#[cfg(any(target_os = "macos", target_os = "freebsd", target_os = "openbsd"))]
pub const ENETUNREACH: i32 = -51;
#[cfg(windows)]
pub const ENETUNREACH: i32 = -118; #[cfg(not(any(
windows,
target_os = "macos",
target_os = "freebsd",
target_os = "openbsd"
)))]
pub const ENETUNREACH: i32 = -101;
pub const EIO: i32 = -5;
pub const AVERROR_INVALIDDATA: i32 = -1_447_971_320;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn error_codes_should_all_be_negative() {
assert!(EAGAIN < 0);
assert!(EOF < 0);
assert!(ENOMEM < 0);
assert!(EINVAL < 0);
}
#[test]
fn averror_invaliddata_should_be_negative_and_distinct_from_einval() {
assert!(AVERROR_INVALIDDATA < 0);
assert_ne!(AVERROR_INVALIDDATA, EINVAL);
}
#[test]
fn averror_invaliddata_should_have_expected_value() {
assert_eq!(AVERROR_INVALIDDATA, -1_447_971_320);
}
}