aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2014-08-22 11:50:27 -0400
committerSteven Fackler <[email protected]>2014-08-22 11:50:27 -0400
commitaba30b530b450b80c57271df61a86bd84df02084 (patch)
treecfdb26069adf63cb06359b7092b35dc65e262e5f
parentMerge pull request #33 from isra17/master (diff)
parentAdd repr(C) to C structs (diff)
downloadrust-openssl-aba30b530b450b80c57271df61a86bd84df02084.tar.xz
rust-openssl-aba30b530b450b80c57271df61a86bd84df02084.zip
Merge pull request #34 from ebfe/repr_c
Add repr(C) to C structs
-rw-r--r--src/bn/mod.rs1
-rw-r--r--src/crypto/hash.rs3
-rw-r--r--src/crypto/hmac.rs2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/bn/mod.rs b/src/bn/mod.rs
index 1982de45..e1ec1360 100644
--- a/src/bn/mod.rs
+++ b/src/bn/mod.rs
@@ -5,6 +5,7 @@ use std::ptr;
use ssl::error::SslError;
#[allow(dead_code)]
+#[repr(C)]
struct BIGNUM {
d: *mut c_void,
top: c_int,
diff --git a/src/crypto/hash.rs b/src/crypto/hash.rs
index 045956ba..2696e77b 100644
--- a/src/crypto/hash.rs
+++ b/src/crypto/hash.rs
@@ -14,6 +14,7 @@ pub enum HashType {
#[allow(dead_code)]
#[allow(non_camel_case_types)]
+#[repr(C)]
pub struct EVP_MD_CTX {
digest: *mut EVP_MD,
engine: *mut libc::c_void,
@@ -24,9 +25,11 @@ pub struct EVP_MD_CTX {
}
#[allow(non_camel_case_types)]
+#[repr(C)]
pub struct EVP_MD;
#[allow(non_camel_case_types)]
+#[repr(C)]
pub struct EVP_PKEY_CTX;
#[link(name = "crypto")]
diff --git a/src/crypto/hmac.rs b/src/crypto/hmac.rs
index 16be0f29..b2df4ea0 100644
--- a/src/crypto/hmac.rs
+++ b/src/crypto/hmac.rs
@@ -19,6 +19,7 @@ use crypto::hash;
#[allow(dead_code)]
#[allow(non_camel_case_types)]
+#[repr(C)]
pub struct HMAC_CTX {
md: *mut hash::EVP_MD,
md_ctx: hash::EVP_MD_CTX,
@@ -37,6 +38,7 @@ extern {
}
#[allow(non_camel_case_types)]
+#[repr(C)]
struct ENGINE;
pub struct HMAC {