Merge branch 'feature/compile-and-run-nginx-wasm' of https://github.com/wafoundation/wasmer into feature/compile-and-run-nginx-wasm

This commit is contained in:
Steve Akinyemi 2018-11-26 23:28:01 +01:00
commit 5d64349894
2 changed files with 12 additions and 1 deletions

View File

@ -329,6 +329,11 @@ pub fn generate_emscripten_env<'a, 'b>() -> ImportObject<&'a str, &'b str> {
"_time",
ImportValue::Func(time::_time as _),
);
import_object.set(
"env",
"_strftime",
ImportValue::Func(time::_strftime as _),
);
import_object.set(
"env",
"_localtime_r",
@ -345,7 +350,7 @@ pub fn generate_emscripten_env<'a, 'b>() -> ImportObject<&'a str, &'b str> {
mock_external!(import_object, _usleep);
// mock_external!(import_object, _time);
mock_external!(import_object, _sysconf);
mock_external!(import_object, _strftime);
// mock_external!(import_object, _strftime);
mock_external!(import_object, _sigsuspend);
mock_external!(import_object, _sigprocmask);
mock_external!(import_object, _sigemptyset);

View File

@ -114,3 +114,9 @@ pub extern "C" fn _time(time_p: u32, instance: &mut Instance) -> time_t {
time(time_p_addr)
}
}
/// emscripten: _strftime
pub extern "C" fn _strftime(s_ptr: c_int, maxsize: u32, format_ptr: c_int, tm_ptr: c_int, instance: &mut Instance) -> time_t {
debug!("emscripten::_strftime {} {} {} {}", s_ptr, maxsize, format_ptr, tm_ptr);
0
}