DEVELOPMENT ENVIRONMENT

~liljamo/hare-rust-ffi-test

hare-rust-ffi-test/main.ha -rw-r--r-- 246 bytes
b76de4b1Jonni Liljamo feat: init 4 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
use fmt;
use types::c;

export @symbol("hello") fn hello(s: const *c::char) const *c::char;

export fn main() void = {
	fmt::println("Hello Hare!")!;
	let rust_hello_ptr = hello(c::nulstr("Rust\0"));
	fmt::println(c::tostr(rust_hello_ptr)!)!;
};