Skip to content

Commit

Permalink
Merge pull request #298 from roc-lang/fix-ci
Browse files Browse the repository at this point in the history
Use `c_char` instead of `i8` for argument FFI
  • Loading branch information
lukewilliamboswell authored Dec 28, 2024
2 parents ab135d8 + e420741 commit 029a324
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/roc_host_lib/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use roc_env::arg::ArgToAndFromHost;
use std::ffi::c_char;

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

0 comments on commit 029a324

Please sign in to comment.