Skip to content

Commit 10db235

Browse files
authored
Update OpenSSL initialization check (#419)
As described in sfackler/rust-openssl#1548
1 parent 142ee96 commit 10db235

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

build.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
use std::env;
2-
use std::str::FromStr;
32

43
fn main() {
54
// OpenSSL >= 1.1.0 can be initialized concurrently and is initialized correctly by libcurl.
65
// <= 1.0.2 need locking callbacks, which are provided by openssl_sys::init().
7-
let use_openssl = match env::var("DEP_OPENSSL_VERSION") {
8-
Ok(ver) => {
9-
let ver = u32::from_str(&ver).unwrap();
10-
if ver < 110 {
6+
let use_openssl = match env::var("DEP_OPENSSL_VERSION_NUMBER") {
7+
Ok(version) => {
8+
let version = u64::from_str_radix(&version, 16).unwrap();
9+
if version < 0x1_01_00_00_0 {
1110
println!("cargo:rustc-cfg=need_openssl_init");
1211
}
1312
true

0 commit comments

Comments
 (0)