diff options
| author | Steven Fackler <[email protected]> | 2016-10-15 13:39:47 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-10-15 13:39:47 -0700 |
| commit | 228b8fbc5b5567f19b66754f589d47851817c411 (patch) | |
| tree | 483cb4c310c6db8b176a70bb88bb205afabdd19d /openssl/src | |
| parent | Merge pull request #474 from sfackler/digest (diff) | |
| download | rust-openssl-228b8fbc5b5567f19b66754f589d47851817c411.tar.xz rust-openssl-228b8fbc5b5567f19b66754f589d47851817c411.zip | |
Correctly bind BIO_new_mem_buf
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/bio.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/openssl/src/bio.rs b/openssl/src/bio.rs index 0d82a6c3..22d2cee3 100644 --- a/openssl/src/bio.rs +++ b/openssl/src/bio.rs @@ -22,7 +22,7 @@ impl<'a> MemBioSlice<'a> { assert!(buf.len() <= c_int::max_value() as usize); let bio = unsafe { - try_ssl_null!(ffi::BIO_new_mem_buf(buf.as_ptr() as *const _, buf.len() as c_int)) + try_ssl_null!(BIO_new_mem_buf(buf.as_ptr() as *const _, buf.len() as c_int)) }; Ok(MemBioSlice(bio, PhantomData)) @@ -65,3 +65,12 @@ impl MemBio { } } } + +#[cfg(not(ossl101))] +use ffi::BIO_new_mem_buf; + +#[cfg(ossl101)] +#[allow(bad_style)] +unsafe fn BIO_new_mem_buf(buf: *const ::libc::c_void, len: ::libc::c_int) -> *mut ffi::BIO { + ffi::BIO_new_mem_buf(buf as *mut _, len) +} |