Unverified Commit 3e5415a6 authored by Steven Fackler's avatar Steven Fackler
Browse files

even even more fixes

parent c5ec56a2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -80,7 +80,8 @@ impl ParseCallbacks for OpensslCallbacks {
            | "BIO_meth_set_ctrl"
            | "BIO_meth_set_create"
            | "BIO_meth_set_destroy"
            | "CRYPTO_set_locking_callback" => Some(format!("{}__fixed_rust", original_item_name)),
            | "CRYPTO_set_locking_callback"
            | "CRYPTO_set_id_callback" => Some(format!("{}__fixed_rust", original_item_name)),
            _ => None,
        }
    }
+3 −0
Original line number Diff line number Diff line
@@ -6,6 +6,9 @@ extern "C" {
    pub fn CRYPTO_set_locking_callback(
        func: unsafe extern "C" fn(mode: c_int, n: c_int, file: *const c_char, line: c_int),
    );

    #[cfg(not(ossl110))]
    pub fn CRYPTO_set_id_callback(func: unsafe extern "C" fn() -> c_ulong);
}

cfg_if! {
+9 −1
Original line number Diff line number Diff line
@@ -30,14 +30,22 @@ extern "C" {

    #[cfg(not(ossl110))]
    pub fn CRYPTO_num_locks() -> c_int;
}

#[allow(clashing_extern_declarations)]
extern "C" {
    #[cfg(not(ossl110))]
    #[link_name = "CRYPTO_set_locking_callback"]
    pub fn CRYPTO_set_locking_callback__fixed_rust(
        func: Option<unsafe extern "C" fn(mode: c_int, n: c_int, file: *const c_char, line: c_int)>,
    );

    #[cfg(not(ossl110))]
    pub fn CRYPTO_set_id_callback(func: unsafe extern "C" fn() -> c_ulong);
    #[link_name = "CRYPTO_set_id_callback"]
    pub fn CRYPTO_set_id_callback__fixed_rust(func: Option<unsafe extern "C" fn() -> c_ulong>);
}

extern "C" {
    #[cfg(not(ossl110))]
    pub fn CRYPTO_add_lock(
        pointer: *mut c_int,
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ pub fn init() {
                }

                unsafe {
                    CRYPTO_set_id_callback(thread_id);
                    CRYPTO_set_id_callback__fixed_rust(Some(thread_id));
                }
            }
        } else {