From f13e65ff8ed7ae2e3aebc59b31951738ef3fc767 Mon Sep 17 00:00:00 2001 From: Folkert Date: Sun, 19 Sep 2021 20:54:32 +0200 Subject: [PATCH] more removal of roccallresult --- examples/cli/platform/src/lib.rs | 12 +++--------- examples/hello-zig/platform/host.zig | 2 -- linker/tests/fib/platform/app.zig | 4 +--- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/examples/cli/platform/src/lib.rs b/examples/cli/platform/src/lib.rs index 682e10de45..2b24da5ff7 100644 --- a/examples/cli/platform/src/lib.rs +++ b/examples/cli/platform/src/lib.rs @@ -4,7 +4,7 @@ use core::alloc::Layout; use core::ffi::c_void; use core::mem::MaybeUninit; use libc; -use roc_std::{RocCallResult, RocStr}; +use roc_std::RocStr; use std::ffi::CStr; 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, ); - let output = &*(buffer as *mut RocCallResult<()>); + std::alloc::dealloc(buffer, layout); - match output.into() { - Ok(_) => { - std::alloc::dealloc(buffer, layout); - 0 - } - Err(e) => panic!("failed with {}", e), - } + 0 } #[no_mangle] diff --git a/examples/hello-zig/platform/host.zig b/examples/hello-zig/platform/host.zig index aa62ac6f03..54883b2fcb 100644 --- a/examples/hello-zig/platform/host.zig +++ b/examples/hello-zig/platform/host.zig @@ -56,8 +56,6 @@ const Allocator = mem.Allocator; extern fn roc__mainForHost_1_exposed(*RocStr) void; -const RocCallResult = extern struct { flag: u64, content: RocStr }; - const Unit = extern struct {}; pub fn main() u8 { diff --git a/linker/tests/fib/platform/app.zig b/linker/tests/fib/platform/app.zig index 7cc1759319..105908633f 100644 --- a/linker/tests/fib/platform/app.zig +++ b/linker/tests/fib/platform/app.zig @@ -1,3 +1 @@ -const RocCallResult = extern struct { flag: usize, content: u64 }; - -export fn roc__mainForHost_1_exposed(_i: i64, _result: *RocCallResult) void{} +export fn roc__mainForHost_1_exposed(_i: i64, _result: *u64) void {}