mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
ignore if set_shared_buffer is not defined
This commit is contained in:
parent
e62a0ee39a
commit
fc01a0ee44
1 changed files with 6 additions and 4 deletions
|
@ -22,13 +22,15 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
|
|||
match env.mode {
|
||||
super::build::LlvmBackendMode::CliTest => {
|
||||
// expose this function
|
||||
let fn_val = module.get_function("set_shared_buffer").unwrap();
|
||||
fn_val.set_linkage(Linkage::External);
|
||||
if let Some(fn_val) = module.get_function("set_shared_buffer") {
|
||||
fn_val.set_linkage(Linkage::External);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
// remove this function from the module
|
||||
let fn_val = module.get_function("set_shared_buffer").unwrap();
|
||||
unsafe { fn_val.delete() };
|
||||
if let Some(fn_val) = module.get_function("set_shared_buffer") {
|
||||
unsafe { fn_val.delete() };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue