mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
generate signature for foreign symbols
This commit is contained in:
parent
4b8392696e
commit
a6e39e66f1
8 changed files with 75 additions and 31 deletions
|
@ -1,5 +1,6 @@
|
|||
use roc_std::alloca;
|
||||
use roc_std::RocCallResult;
|
||||
use roc_std::RocStr;
|
||||
use std::alloc::Layout;
|
||||
use std::time::SystemTime;
|
||||
|
||||
|
@ -25,6 +26,15 @@ pub fn roc_fx_putChar(foo: i64) -> () {
|
|||
()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn roc_fx_putLine(line: RocStr) -> () {
|
||||
let bytes = line.as_slice();
|
||||
let string = unsafe { std::str::from_utf8_unchecked(bytes) };
|
||||
println!("{}", string);
|
||||
|
||||
()
|
||||
}
|
||||
|
||||
unsafe fn call_the_closure(function_pointer: *const u8, closure_data_ptr: *const u8) -> i64 {
|
||||
let size = size_Fx() as usize;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue