Skip to content

Commit e420741

Browse files
use ptr to c_char instead of i8 for arg FFI
1 parent ab135d8 commit e420741

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/roc_host_lib/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
use roc_env::arg::ArgToAndFromHost;
2+
use std::ffi::c_char;
23

34
/// # Safety
45
/// This function is the entry point for the program, it will be linked by roc using the legacy linker
56
/// to produce the final executable.
67
///
78
/// Note we use argc and argv to pass arguments to the program instead of std::env::args().
89
#[no_mangle]
9-
pub unsafe extern "C" fn main(argc: usize, argv: *const *const i8) -> i32 {
10+
pub unsafe extern "C" fn main(argc: usize, argv: *const *const c_char) -> i32 {
1011
let args = std::slice::from_raw_parts(argv, argc)
1112
.iter()
1213
.map(|&c_ptr| {

0 commit comments

Comments
 (0)