mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 02:46:29 +03:00
feat(ffi): install global panic handler (#108)
This commit is contained in:
committed by
Lars-Magnus Skog
parent
5c8bfd4370
commit
a2fc127923
@@ -17,6 +17,7 @@ crate-type = ["cdylib", "staticlib"]
|
||||
[dependencies]
|
||||
deltachat = { path = "../" }
|
||||
libc = "0.2"
|
||||
human-panic = "1.0.1"
|
||||
|
||||
[features]
|
||||
default = ["deltachat/vendored"]
|
||||
default = ["deltachat/vendored"]
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
non_snake_case
|
||||
)]
|
||||
|
||||
extern crate deltachat;
|
||||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate human_panic;
|
||||
|
||||
use deltachat::*;
|
||||
|
||||
@@ -28,6 +28,8 @@ pub unsafe extern "C" fn dc_context_new(
|
||||
userdata: *mut libc::c_void,
|
||||
os_name: *const libc::c_char,
|
||||
) -> *mut dc_context_t {
|
||||
setup_panic!();
|
||||
|
||||
let ctx = context::dc_context_new(cb, userdata, os_name);
|
||||
Box::into_raw(Box::new(ctx))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user