diff options
Diffstat (limited to 'systest/build.rs')
| -rw-r--r-- | systest/build.rs | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/systest/build.rs b/systest/build.rs index af8ebbc1..457d372b 100644 --- a/systest/build.rs +++ b/systest/build.rs @@ -28,13 +28,14 @@ fn main() { is_libressl = true; } else if let Ok(version) = env::var("DEP_OPENSSL_VERSION") { cfg.cfg(&format!("ossl{}", version), None); + if version == "111" { + cfg.cfg("ossl110", None); + } } - if let (Ok(version), Ok(patch)) = - ( - env::var("DEP_OPENSSL_VERSION"), - env::var("DEP_OPENSSL_PATCH"), - ) - { + if let (Ok(version), Ok(patch)) = ( + env::var("DEP_OPENSSL_VERSION"), + env::var("DEP_OPENSSL_PATCH"), + ) { cfg.cfg(&format!("ossl{}{}", version, patch), None); } if let Ok(vars) = env::var("DEP_OPENSSL_CONF") { @@ -74,10 +75,12 @@ fn main() { } else if s == "_STACK" { format!("struct stack_st") // This logic should really be cleaned up - } else if is_struct && s != "point_conversion_form_t" && - s.chars().next().unwrap().is_lowercase() + } else if is_struct && s != "point_conversion_form_t" + && s.chars().next().unwrap().is_lowercase() { format!("struct {}", s) + } else if s.starts_with("stack_st_") { + format!("struct {}", s) } else { format!("{}", s) } @@ -104,13 +107,15 @@ fn main() { (s == "GENERAL_NAME" && field == "d") // union }); cfg.skip_signededness(|s| { - s.ends_with("_cb") || s.ends_with("_CB") || s.ends_with("_cb_fn") || - s.starts_with("CRYPTO_") || s == "PasswordCallback" + s.ends_with("_cb") || s.ends_with("_CB") || s.ends_with("_cb_fn") + || s.starts_with("CRYPTO_") || s == "PasswordCallback" }); - cfg.field_name(|_s, field| if field == "type_" { - format!("type") - } else { - format!("{}", field) + cfg.field_name(|_s, field| { + if field == "type_" { + format!("type") + } else { + format!("{}", field) + } }); cfg.fn_cname(|rust, link_name| link_name.unwrap_or(rust).to_string()); cfg.generate("../openssl-sys/src/lib.rs", "all.rs"); |