fix(c-api) Mark wasi_env_set_(instance|memory) as deprecated.

This commit is contained in:
Ivan Enderlin
2021-02-01 11:55:38 +01:00
parent cbc8b4a773
commit 277d85c5ae

View File

@@ -199,30 +199,22 @@ pub extern "C" fn wasi_env_delete(_state: Option<Box<wasi_env_t>>) {}
/// This function is deprecated. You may safely remove all calls to it and everything /// This function is deprecated. You may safely remove all calls to it and everything
/// will continue to work. /// will continue to work.
// Dead code: deprecate or remove ///
#[allow(unused_variables)] /// cbindgen:prefix=DEPRECATED("This function is longer necessary. You may safely remove all calls to it and everything will continue to work.")
#[no_mangle] #[no_mangle]
pub extern "C" fn wasi_env_set_instance(env: &mut wasi_env_t, instance: &wasm_instance_t) -> bool { pub extern "C" fn wasi_env_set_instance(
/* _env: &mut wasi_env_t,
let memory = if let Ok(memory) = instance.inner.exports.get_memory("memory") { _instance: &wasm_instance_t,
memory ) -> bool {
} else {
return false;
};
env.inner.set_memory(memory.clone());
*/
true true
} }
/// This function is deprecated. You may safely remove all calls to it and everything /// This function is deprecated. You may safely remove all calls to it and everything
/// will continue to work. /// will continue to work.
// Dead code: deprecate or remove ///
#[allow(unused_variables)] /// cbindgen:prefix=DEPRECATED("This function is no longer necessary. You may safely remove all calls to it and everything will continue to work.")
#[no_mangle] #[no_mangle]
pub extern "C" fn wasi_env_set_memory(env: &mut wasi_env_t, memory: &wasm_memory_t) { pub extern "C" fn wasi_env_set_memory(_env: &mut wasi_env_t, _memory: &wasm_memory_t) {}
//env.inner.set_memory(memory.inner.clone());
}
#[no_mangle] #[no_mangle]
pub unsafe extern "C" fn wasi_env_read_stdout( pub unsafe extern "C" fn wasi_env_read_stdout(