mirror of
https://github.com/Noratrieb/libuwuc.git
synced 2026-01-14 11:45:05 +01:00
cleanup
This commit is contained in:
parent
b795ee80c9
commit
d03d027a54
6 changed files with 11 additions and 8 deletions
|
|
@ -7,3 +7,4 @@ panic = "abort"
|
|||
|
||||
[profile.release]
|
||||
panic = "abort"
|
||||
lto = "thin"
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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}");
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -10,5 +10,6 @@
|
|||
packages = (with pkgs; [
|
||||
gef
|
||||
rust-bindgen
|
||||
shellcheck
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ clean() {
|
|||
}
|
||||
|
||||
for test in "$SCRIPT_DIR"/tests/c/*; do
|
||||
name=$(basename $test .c)
|
||||
printf "test $name "
|
||||
name=$(basename "$test" .c)
|
||||
printf "test %s " "$test"
|
||||
|
||||
flags=$(grep "//@flags: " "$test" | sed 's#//@flags: ##')
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ for test in "$SCRIPT_DIR"/tests/c/*; do
|
|||
exit 1
|
||||
fi
|
||||
|
||||
cd "$SCRIPT_DIR/tests"
|
||||
cd "$SCRIPT_DIR/tests" || exit 1
|
||||
OUTPUT=$("$test_dir/$name")
|
||||
code="$?"
|
||||
if [ "$code" -ne "0" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue