Skip to content

Commit

Permalink
Implement __assert_func
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 24, 2023
1 parent 75557a5 commit 2b01430
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions esp-wifi/src/common_adapter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,23 @@ static mut WIFI_EVENT: esp_event_base_t = unsafe { &EVT };
// stuff needed by wpa-supplicant
#[no_mangle]
pub unsafe extern "C" fn __assert_func(
_file: *const u8,
_line: u32,
_func: *const u8,
_failed_expr: *const u8,
file: *const u8,
line: u32,
func: *const u8,
failed_expr: *const u8,
) {
todo!("__assert_func");
let file = str_from_c(file);
let (func_pre, func) = if func.is_null() {
("", "")
} else {
(", function: ", str_from_c(func))
};
let expr = str_from_c(failed_expr);

panic!(
"assertion \"{}\" failed: file \"{}\", line {}{}{}",
expr, file, line, func_pre, func
);
}

#[no_mangle]
Expand Down

0 comments on commit 2b01430

Please sign in to comment.