From c4a275dc37a705568c9d6a5a0be8b85214a7db34 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Fri, 22 Aug 2014 17:16:16 +0200 Subject: Add repr(C) to C structs --- src/crypto/hash.rs | 3 +++ src/crypto/hmac.rs | 2 ++ 2 files changed, 5 insertions(+) (limited to 'src/crypto') 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 { -- cgit v1.2.3