This commit is contained in:
nora 2023-10-04 21:52:07 +02:00
parent b795ee80c9
commit d03d027a54
6 changed files with 11 additions and 8 deletions

View file

@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["staticlib", "rlib"]
crate-type = ["staticlib", "rlib", "cdylib"]
[dependencies]

View file

@ -2,6 +2,7 @@
#![feature(c_variadic)]
#![feature(panic_info_message)]
#![deny(clippy::no_mangle_with_rust_abi)]
#![warn(rust_2018_idioms)]
mod rt;
mod stdio;
@ -19,7 +20,7 @@ fn rust_eh_personality() {
#[panic_handler]
#[cfg(not(test))]
fn handler(arg: &core::panic::PanicInfo) -> ! {
fn handler(arg: &core::panic::PanicInfo<'_>) -> ! {
let args = format_args!("<no message>");
let payload = arg.message().unwrap_or(&args);
libuwuc::io::println!("panicked: {payload}");

View file

@ -14,7 +14,7 @@ pub unsafe extern "C" fn puts(s: *const c_char) -> i32 {
// RAW FD:
#[no_mangle]
pub unsafe extern "C" fn open(path: SharedThinCstr, flags: i32) -> Fd {
pub unsafe extern "C" fn open(path: SharedThinCstr<'_>, flags: i32) -> Fd {
libuwuc::io::fd::open(path, flags).into_ok_or_errno()
}
@ -88,8 +88,8 @@ pub static stderr: &FileStream = &FileStream::from_raw_fd(STDERR);
#[no_mangle]
pub unsafe extern "C" fn fopen<'a>(
pathname: SharedThinCstr,
mode: SharedThinCstr,
pathname: SharedThinCstr<'_>,
mode: SharedThinCstr<'_>,
) -> Option<&'a FileStream> {
libuwuc::io::stream::fopen(pathname, mode)
.map_err(|err| libuwuc::error::set_errno(err.0))