Use the correct return type for puts

This commit is contained in:
bjorn3 2020-04-17 19:33:57 +02:00
parent 9f602bf4da
commit 51d07790df
3 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@
#[link(name = "c")]
extern "C" {
fn puts(s: *const u8);
fn puts(s: *const u8) -> i32;
}
#[panic_handler]

View File

@ -488,7 +488,7 @@ pub mod intrinsics {
pub mod libc {
#[link(name = "c")]
extern "C" {
pub fn puts(s: *const u8);
pub fn puts(s: *const u8) -> i32;
pub fn printf(format: *const i8, ...) -> i32;
pub fn malloc(size: usize) -> *mut u8;
pub fn free(ptr: *mut u8);

View File

@ -12,7 +12,7 @@ fn codegen_print(fx: &mut FunctionCx<'_, '_, impl cranelift_module::Backend>, ms
&Signature {
call_conv: CallConv::triple_default(fx.triple()),
params: vec![AbiParam::new(pointer_ty(fx.tcx))],
returns: vec![],
returns: vec![AbiParam::new(types::I32)],
},
)
.unwrap();