Loading openssl/src/crypto.rs +13 −2 Original line number Diff line number Diff line use libc::{c_char, c_void}; use libc::{c_char, c_int, c_void}; use std::fmt; use std::ffi::CStr; use std::slice; Loading @@ -10,7 +10,9 @@ pub struct CryptoString(&'static str); impl<'s> Drop for CryptoString { fn drop(&mut self) { unsafe { CRYPTO_free!(self.0.as_ptr() as *mut c_void); CRYPTO_free(self.0.as_ptr() as *mut c_void, concat!(file!(), "\0").as_ptr() as *const c_char, line!() as c_int); } } } Loading Loading @@ -46,3 +48,12 @@ impl fmt::Debug for CryptoString { fmt::Debug::fmt(self.0, f) } } #[cfg(not(ossl110))] #[allow(non_snake_case)] unsafe fn CRYPTO_free(buf: *mut c_void, _: *const c_char, _: c_int) { ::ffi::CRYPTO_free(buf); } #[cfg(ossl110)] use ffi::CRYPTO_free; openssl/src/lib.rs +0 −2 Original line number Diff line number Diff line Loading @@ -20,8 +20,6 @@ use libc::c_int; use error::ErrorStack; mod macros; mod bio; mod opaque; mod util; Loading openssl/src/macros.rsdeleted 100644 → 0 +0 −15 Original line number Diff line number Diff line #![macro_use] #[cfg(ossl10x)] macro_rules! CRYPTO_free { ($e:expr) => (::ffi::CRYPTO_free($e)) } #[cfg(ossl110)] macro_rules! CRYPTO_free { ($e:expr) => ( ::ffi::CRYPTO_free($e, concat!(file!(), "\0").as_ptr() as *const _, line!() as i32) ) } Loading
openssl/src/crypto.rs +13 −2 Original line number Diff line number Diff line use libc::{c_char, c_void}; use libc::{c_char, c_int, c_void}; use std::fmt; use std::ffi::CStr; use std::slice; Loading @@ -10,7 +10,9 @@ pub struct CryptoString(&'static str); impl<'s> Drop for CryptoString { fn drop(&mut self) { unsafe { CRYPTO_free!(self.0.as_ptr() as *mut c_void); CRYPTO_free(self.0.as_ptr() as *mut c_void, concat!(file!(), "\0").as_ptr() as *const c_char, line!() as c_int); } } } Loading Loading @@ -46,3 +48,12 @@ impl fmt::Debug for CryptoString { fmt::Debug::fmt(self.0, f) } } #[cfg(not(ossl110))] #[allow(non_snake_case)] unsafe fn CRYPTO_free(buf: *mut c_void, _: *const c_char, _: c_int) { ::ffi::CRYPTO_free(buf); } #[cfg(ossl110)] use ffi::CRYPTO_free;
openssl/src/lib.rs +0 −2 Original line number Diff line number Diff line Loading @@ -20,8 +20,6 @@ use libc::c_int; use error::ErrorStack; mod macros; mod bio; mod opaque; mod util; Loading
openssl/src/macros.rsdeleted 100644 → 0 +0 −15 Original line number Diff line number Diff line #![macro_use] #[cfg(ossl10x)] macro_rules! CRYPTO_free { ($e:expr) => (::ffi::CRYPTO_free($e)) } #[cfg(ossl110)] macro_rules! CRYPTO_free { ($e:expr) => ( ::ffi::CRYPTO_free($e, concat!(file!(), "\0").as_ptr() as *const _, line!() as i32) ) }