mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Conditionally define macro that's only used in Linux builds.
This commit is contained in:
parent
74ff7f957f
commit
be98fef8f7
1 changed files with 5 additions and 5 deletions
|
@ -505,11 +505,6 @@ mod system_reporter {
|
||||||
None
|
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")]
|
#[cfg(target_os = "linux")]
|
||||||
fn page_size() -> usize {
|
fn page_size() -> usize {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -522,6 +517,11 @@ mod system_reporter {
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Read;
|
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 f = option_try!(File::open("/proc/self/statm").ok());
|
||||||
let mut contents = String::new();
|
let mut contents = String::new();
|
||||||
option_try!(f.read_to_string(&mut contents).ok());
|
option_try!(f.read_to_string(&mut contents).ok());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue