#![no_main] #![no_std] extern crate libc; mod c; use core::fmt::Write; #[no_mangle] pub extern "C" fn main(_nargs: libc::c_int, _args: *const *const libc::c_char) -> libc::c_int { let x = c::string::CString::from("foo"); let y = c::string::CBox::new(x); //let foo = cstr!("Foo! %p\n"); //c::stdio::stdout().puts(foo); let mut stdout = c::stdio::stdout(); writeln!(stdout, "Foo: {}", 42); 0 } #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { unsafe { libc::abort() } }