Browse Source

Use abort() when panicking

pull/10/head
Fenrir 9 years ago
parent
commit
b75b7f804a
  1. 1
      ctru-sys/src/sys/libc.rs
  2. 2
      src/lib.rs

1
ctru-sys/src/sys/libc.rs

@ -7,5 +7,6 @@ pub enum c_void {
} }
extern "C" { extern "C" {
pub fn abort() -> !;
pub fn write(fd: i32, buf: *const c_void, count: usize) -> isize; pub fn write(fd: i32, buf: *const c_void, count: usize) -> isize;
} }

2
src/lib.rs

@ -20,5 +20,5 @@ pub use sdmc::Sdmc;
extern "C" fn eh_personality() {} extern "C" fn eh_personality() {}
#[lang = "panic_fmt"] #[lang = "panic_fmt"]
fn panic_fmt() -> ! { fn panic_fmt() -> ! {
loop {} unsafe { libctru::libc::abort() }
} }

Loading…
Cancel
Save