put option_try macro def under #[cfg(unix)]

This commit is contained in:
est31 2017-05-16 08:53:02 +02:00
parent 25b7f10c78
commit 6dbd706906

View File

@ -116,6 +116,7 @@ pub fn record_time<T, F>(accu: &Cell<Duration>, f: F) -> T where
}
// Like std::macros::try!, but for Option<>.
#[cfg(unix)]
macro_rules! option_try(
($e:expr) => (match $e { Some(e) => e, None => return None })
);