Added mock for _strftime

This commit is contained in:
Syrus Akbary 2018-11-26 14:16:51 -08:00
parent ac51a33d5e
commit 0ba5f1ecb7
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

@ -82,3 +82,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
}