This commit is contained in:
Jeremy Soller
2018-11-25 10:34:42 -07:00
parent a5279b648f
commit 0ac16556bc
24 changed files with 474 additions and 349 deletions
+15 -2
View File
@@ -6,11 +6,24 @@ use header::{stdio, stdlib};
use platform::types::*;
#[no_mangle]
pub unsafe extern "C" fn __assert(func: *const c_char, file: *const c_char, line: c_int, cond: *const c_char) {
pub unsafe extern "C" fn __assert(
func: *const c_char,
file: *const c_char,
line: c_int,
cond: *const c_char,
) {
let func = CStr::from_ptr(func).to_str().unwrap();
let file = CStr::from_ptr(file).to_str().unwrap();
let cond = CStr::from_ptr(cond).to_str().unwrap();
write!(*stdio::stderr, "{}: {}:{}: Assertion `{}` failed.\n", func, file, line, cond).unwrap();
write!(
*stdio::stderr,
"{}: {}:{}: Assertion `{}` failed.\n",
func,
file,
line,
cond
)
.unwrap();
stdlib::abort();
}