mirror of
https://github.com/Noratrieb/libuwuc.git
synced 2026-01-14 19:55:07 +01:00
c test program
This commit is contained in:
parent
54e0e7604e
commit
1baf8df4a8
18 changed files with 150 additions and 68 deletions
16
example-user/Cargo.lock
generated
16
example-user/Cargo.lock
generated
|
|
@ -2,13 +2,6 @@
|
|||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "c"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libuwuc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
|
|
@ -19,8 +12,8 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||
name = "example-user"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"c",
|
||||
"libuwuc",
|
||||
"rawc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -29,3 +22,10 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rawc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"libuwuc",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -14,5 +14,5 @@ panic = "abort"
|
|||
panic = "abort"
|
||||
|
||||
[dependencies]
|
||||
c = { path = "../c" }
|
||||
rawc = { path = "../rawc" }
|
||||
libuwuc = { path = "../libuwuc" }
|
||||
|
|
@ -6,19 +6,7 @@ use core::ffi::c_char;
|
|||
|
||||
use libuwuc::{println, utils::SharedThinCstr};
|
||||
|
||||
extern crate c;
|
||||
|
||||
#[panic_handler]
|
||||
#[cfg(not(test))]
|
||||
fn handler(arg: &core::panic::PanicInfo) -> ! {
|
||||
let args = format_args!("<no message>");
|
||||
let payload = arg.message().unwrap_or(&args);
|
||||
libuwuc::io::println!("panicked: {payload}");
|
||||
if let Some(loc) = arg.location() {
|
||||
libuwuc::io::println!(" at {}:{}:{}", loc.file(), loc.line(), loc.column());
|
||||
}
|
||||
libuwuc::start::exit(1);
|
||||
}
|
||||
extern crate rawc;
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn main(_argc: i32, _argv: *const *const c_char) -> i32 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue