summaryrefslogtreecommitdiffstats
path: root/ffi-macros
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2020-04-02 13:59:51 +0200
committerNeal H. Walfield <neal@pep.foundation>2020-04-02 16:42:50 +0200
commit1e177d46893824f92d730a58dc0b006a52f2e5d4 (patch)
tree6d29b31097a075d4ba0b8a3ab08408c466f6ecf6 /ffi-macros
parent5b48c5ee08aedc4126c7b8f566cc3181e865fa20 (diff)
ffi-macros: Increase the length of acceptable C type names.
- This is needed to deal with pgp_cert_valid_user_id_amalgamation_t, for instance.
Diffstat (limited to 'ffi-macros')
-rw-r--r--ffi-macros/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ffi-macros/src/lib.rs b/ffi-macros/src/lib.rs
index 756c1bc6..db37daef 100644
--- a/ffi-macros/src/lib.rs
+++ b/ffi-macros/src/lib.rs
@@ -404,7 +404,7 @@ fn derive_conversion_functions(mut st: syn::ItemStruct,
let magic_value = hash_ident(&wrapper);
// To help during debugging, we store the name of the type.
- const C_TYPE_NAME_LEN: usize = 32;
+ const C_TYPE_NAME_LEN: usize = 48;
let c_type_name_type = syn::parse_quote!([u8; #C_TYPE_NAME_LEN]);
let mut c_type_name_padded = [0u8; C_TYPE_NAME_LEN];
&mut c_type_name_padded[..::std::cmp::min(C_TYPE_NAME_LEN,
@@ -412,7 +412,7 @@ fn derive_conversion_functions(mut st: syn::ItemStruct,
.copy_from_slice(c_type_name.as_bytes());
let c_type_name_padded_literal =
syn::parse_str::<proc_macro2::TokenStream>(
- &format!("{:?}", c_type_name_padded))
+ &format!("{:?}", &c_type_name_padded[..]))
.expect("parsing array failed");
let ownership =