Mocks for _getcontext, _makecontext, _setcontext and _swapcontext

This commit is contained in:
Jesús Leganés-Combarro 'piranna 2019-05-19 20:53:24 +02:00
parent f8cfb04e29
commit 8995060f9b
2 changed files with 23 additions and 0 deletions

View File

@ -856,3 +856,20 @@ pub fn invoke_viidddddddd(
a10 a10
); );
} }
// ucontext.h
pub fn _getcontext(_ctx: &mut Ctx, _ucp: i32) -> i32 {
debug!("emscripten::_getcontext({})", _ucp);
0
}
pub fn _makecontext(_ctx: &mut Ctx, _ucp: i32, _func: i32, _argc: i32, _argv: i32) {
debug!("emscripten::_makecontext({}, {}, {}, {})", _ucp, _func, _argc, _argv);
}
pub fn _setcontext(_ctx: &mut Ctx, _ucp: i32) -> i32 {
debug!("emscripten::_setcontext({})", _ucp);
0
}
pub fn _swapcontext(_ctx: &mut Ctx, _oucp: i32, _ucp: i32) -> i32 {
debug!("emscripten::_swapcontext({}, {})", _oucp, _ucp);
0
}

View File

@ -822,6 +822,12 @@ pub fn generate_emscripten_env(globals: &mut EmscriptenGlobals) -> ImportObject
"invoke_viid" => func!(crate::emscripten_target::invoke_viid), "invoke_viid" => func!(crate::emscripten_target::invoke_viid),
"invoke_viidii" => func!(crate::emscripten_target::invoke_viidii), "invoke_viidii" => func!(crate::emscripten_target::invoke_viidii),
"invoke_viidddddddd" => func!(crate::emscripten_target::invoke_viidddddddd), "invoke_viidddddddd" => func!(crate::emscripten_target::invoke_viidddddddd),
// ucontext.h
"_getcontext" => func!(crate::emscripten_target::_getcontext),
"_makecontext" => func!(crate::emscripten_target::_makecontext),
"_setcontext" => func!(crate::emscripten_target::_setcontext),
"_swapcontext" => func!(crate::emscripten_target::_swapcontext),
}; };
for null_func_name in globals.null_func_names.iter() { for null_func_name in globals.null_func_names.iter() {