mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 23:36:30 +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]
|
[dependencies]
|
||||||
deltachat = { path = "../" }
|
deltachat = { path = "../" }
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
human-panic = "1.0.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["deltachat/vendored"]
|
default = ["deltachat/vendored"]
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
non_snake_case
|
non_snake_case
|
||||||
)]
|
)]
|
||||||
|
|
||||||
extern crate deltachat;
|
#[macro_use]
|
||||||
extern crate libc;
|
extern crate human_panic;
|
||||||
|
|
||||||
use deltachat::*;
|
use deltachat::*;
|
||||||
|
|
||||||
@@ -28,6 +28,8 @@ pub unsafe extern "C" fn dc_context_new(
|
|||||||
userdata: *mut libc::c_void,
|
userdata: *mut libc::c_void,
|
||||||
os_name: *const libc::c_char,
|
os_name: *const libc::c_char,
|
||||||
) -> *mut dc_context_t {
|
) -> *mut dc_context_t {
|
||||||
|
setup_panic!();
|
||||||
|
|
||||||
let ctx = context::dc_context_new(cb, userdata, os_name);
|
let ctx = context::dc_context_new(cb, userdata, os_name);
|
||||||
Box::into_raw(Box::new(ctx))
|
Box::into_raw(Box::new(ctx))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user