mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
more removal of roccallresult
This commit is contained in:
parent
cb82bcb173
commit
f13e65ff8e
3 changed files with 4 additions and 14 deletions
|
@ -4,7 +4,7 @@ use core::alloc::Layout;
|
||||||
use core::ffi::c_void;
|
use core::ffi::c_void;
|
||||||
use core::mem::MaybeUninit;
|
use core::mem::MaybeUninit;
|
||||||
use libc;
|
use libc;
|
||||||
use roc_std::{RocCallResult, RocStr};
|
use roc_std::RocStr;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::os::raw::c_char;
|
use std::os::raw::c_char;
|
||||||
|
|
||||||
|
@ -93,15 +93,9 @@ unsafe fn call_the_closure(closure_data_ptr: *const u8) -> i64 {
|
||||||
buffer as *mut u8,
|
buffer as *mut u8,
|
||||||
);
|
);
|
||||||
|
|
||||||
let output = &*(buffer as *mut RocCallResult<()>);
|
|
||||||
|
|
||||||
match output.into() {
|
|
||||||
Ok(_) => {
|
|
||||||
std::alloc::dealloc(buffer, layout);
|
std::alloc::dealloc(buffer, layout);
|
||||||
|
|
||||||
0
|
0
|
||||||
}
|
|
||||||
Err(e) => panic!("failed with {}", e),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
|
@ -56,8 +56,6 @@ const Allocator = mem.Allocator;
|
||||||
|
|
||||||
extern fn roc__mainForHost_1_exposed(*RocStr) void;
|
extern fn roc__mainForHost_1_exposed(*RocStr) void;
|
||||||
|
|
||||||
const RocCallResult = extern struct { flag: u64, content: RocStr };
|
|
||||||
|
|
||||||
const Unit = extern struct {};
|
const Unit = extern struct {};
|
||||||
|
|
||||||
pub fn main() u8 {
|
pub fn main() u8 {
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
const RocCallResult = extern struct { flag: usize, content: u64 };
|
export fn roc__mainForHost_1_exposed(_i: i64, _result: *u64) void {}
|
||||||
|
|
||||||
export fn roc__mainForHost_1_exposed(_i: i64, _result: *RocCallResult) void{}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue