From be98fef8f764f88834cfbbf4dcc75303bd4cdec2 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 29 May 2017 14:52:44 -0400 Subject: [PATCH] Conditionally define macro that's only used in Linux builds. --- components/profile/mem.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/profile/mem.rs b/components/profile/mem.rs index 5fed9835414f..6046d84145c1 100644 --- a/components/profile/mem.rs +++ b/components/profile/mem.rs @@ -505,11 +505,6 @@ mod system_reporter { None } - // Like std::macros::try!, but for Option<>. - macro_rules! option_try( - ($e:expr) => (match $e { Some(e) => e, None => return None }) - ); - #[cfg(target_os = "linux")] fn page_size() -> usize { unsafe { @@ -522,6 +517,11 @@ mod system_reporter { use std::fs::File; use std::io::Read; + // Like std::macros::try!, but for Option<>. + macro_rules! option_try( + ($e:expr) => (match $e { Some(e) => e, None => return None }) + ); + let mut f = option_try!(File::open("/proc/self/statm").ok()); let mut contents = String::new(); option_try!(f.read_to_string(&mut contents).ok());