Skip to content

Add back in std-only trait definitions #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2019
Merged
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
34 changes: 14 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,27 +159,21 @@ pub use crate::error::Error;

#[allow(dead_code)]
mod util;
// Unlike the other Unix, Fuchsia and iOS don't use the libc to make any calls.
#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "haiku",
target_os = "illumos",
target_os = "linux",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
))]
#[allow(dead_code)]
mod util_libc;

// std-only trait definitions
#[cfg(feature = "std")]
mod error_impls;
cfg_if! {
// Unlike the other Unix, Fuchsia and iOS don't use the libc to make any calls.
if #[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "emscripten",
target_os = "freebsd", target_os = "haiku", target_os = "illumos",
target_os = "linux", target_os = "macos", target_os = "netbsd",
target_os = "openbsd", target_os = "redox", target_os = "solaris"))] {
#[allow(dead_code)]
mod util_libc;
// Keep std-only trait definitions for backwards compatiblity
mod error_impls;
} else if #[cfg(feature = "std")] {
mod error_impls;
}
}

// These targets read from a file as a fallback method.
#[cfg(any(
Expand Down