wasmer/lib/emscripten/src/io/windows.rs

47 lines
1.3 KiB
Rust
Raw Normal View History

use wasmer_runtime_core::vm::Ctx;
// This may be problematic for msvc which uses inline functions for the printf family
// this cfg_attr will try to link with the legacy lib that does not inline printf
// this will allow for compiliation, but will produce a linker error if there is a problem
// finding printf.
//#[cfg_attr(
// all(windows, target_env = "msvc"),
// link(name = "legacy_stdio_definitions", kind = "static-nobundle")
//)]
//extern "C" {
// #[link_name = "printf"]
// pub fn _printf(s: *const c_char, ...) -> c_int;
//}
/// putchar
2019-03-15 21:10:17 +00:00
pub fn putchar(_ctx: &mut Ctx, chr: i32) {
unsafe { libc::putchar(chr) };
}
/// printf
2019-03-15 21:10:17 +00:00
pub fn printf(_ctx: &mut Ctx, memory_offset: i32, extra: i32) -> i32 {
debug!("emscripten::printf {}, {}", memory_offset, extra);
2019-03-15 21:10:17 +00:00
#[cfg(not(feature = "debug"))]
{
let _ = memory_offset;
let _ = extra;
}
// unsafe {
// let addr = emscripten_memory_pointer!(ctx.memory(0), memory_offset) as _;
// _printf(addr, extra)
// }
-1
}
/// chroot
2019-03-27 02:00:09 +00:00
pub fn chroot(_ctx: &mut Ctx, _name_ptr: i32) -> i32 {
debug!("emscripten::chroot");
unimplemented!()
}
2019-03-25 18:58:44 +00:00
/// getpwuid
2019-03-27 02:00:09 +00:00
pub fn getpwuid(_ctx: &mut Ctx, _uid: i32) -> i32 {
2019-03-25 18:58:44 +00:00
debug!("emscripten::getpwuid");
unimplemented!()
}