remove unix-specific code from code windows sees

This commit is contained in:
Mark McCaskey
2019-07-01 11:42:50 -07:00
parent 4fcb3c4c83
commit d825fe9eb2
5 changed files with 252 additions and 237 deletions

View File

@ -5,9 +5,9 @@ use std::ffi::CString;
use std::mem;
use std::os::raw::c_char;
use crate::env::call_malloc;
use crate::env::{call_malloc, EmAddrInfo};
use crate::utils::{copy_cstr_into_wasm, read_string_from_wasm};
use wasmer_runtime_core::vm::Ctx;
use wasmer_runtime_core::{memory::ptr::WasmPtr, vm::Ctx};
extern "C" {
#[link_name = "_putenv"]
@ -131,3 +131,19 @@ pub fn _sysconf(_ctx: &mut Ctx, name: c_int) -> c_long {
// stub because sysconf is not valid on windows
0
}
pub fn _gai_strerror(_ctx: &mut Ctx, _ecode: i32) -> i32 {
debug!("emscripten::_gai_strerror({}) - stub", _ecode);
-1
}
pub fn _getaddrinfo(
ctx: &mut Ctx,
node_ptr: WasmPtr<c_char>,
service_str_ptr: WasmPtr<c_char>,
hints_ptr: WasmPtr<EmAddrInfo>,
res_val_ptr: WasmPtr<WasmPtr<EmAddrInfo>>,
) -> i32 {
debug!("emscripten::_getaddrinfo -- stub");
-1
}