Hi!
Right now there is really no easy way in stable rust (without rust-lang/rust#82679), to make methods conditional on the OS.
You cant do:
#[cfg(unix)]
#[qjs(get, enumerable)]
pub fn atime_ms(&self) -> i64 {
self.metadata.atime_nsec() / 1e6 as i64
}
Since the cfg is evaluated after the methods macro.
I see two ways to get around that. One is allowing multiple methods macros (though I know this is hard). The other would be to support the cfg inside the macro.
Hi!
Right now there is really no easy way in stable rust (without rust-lang/rust#82679), to make methods conditional on the OS.
You cant do:
Since the cfg is evaluated after the
methodsmacro.I see two ways to get around that. One is allowing multiple
methodsmacros (though I know this is hard). The other would be to support thecfginside the macro.