From ad7d2c55f49c5b97155c5d26e9cf763ab5a0157f Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 2 Sep 2024 20:18:06 -0700 Subject: [PATCH] fix 3.2.0 thread support and simplify --- openssl-sys/build/main.rs | 2 +- openssl-sys/build/run_bindgen.rs | 2 +- openssl-sys/src/handwritten/mod.rs | 4 ++-- systest/build.rs | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/openssl-sys/build/main.rs b/openssl-sys/build/main.rs index c5ed22961..50ecc0f08 100644 --- a/openssl-sys/build/main.rs +++ b/openssl-sys/build/main.rs @@ -74,7 +74,7 @@ fn check_ssl_kind() { } fn main() { - println!("cargo:rustc-check-cfg=cfg(osslconf, values(\"OPENSSL_THREADS\", \"OPENSSL_NO_OCB\", \"OPENSSL_NO_SM4\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_CHACHA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_RC4\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_PSK\", \"OPENSSL_NO_DEPRECATED_3_0\", \"OPENSSL_NO_SCRYPT\", \"OPENSSL_NO_SM3\", \"OPENSSL_NO_RMD160\", \"OPENSSL_NO_EC2M\", \"OPENSSL_NO_OCSP\", \"OPENSSL_NO_CMS\", \"OPENSSL_NO_COMP\", \"OPENSSL_NO_SOCK\", \"OPENSSL_NO_STDIO\", \"OPENSSL_NO_EC\", \"OPENSSL_NO_SSL3_METHOD\", \"OPENSSL_NO_KRB5\", \"OPENSSL_NO_TLSEXT\", \"OPENSSL_NO_SRP\", \"OPENSSL_NO_RFC3779\", \"OPENSSL_NO_SHA\", \"OPENSSL_NO_NEXTPROTONEG\", \"OPENSSL_NO_ENGINE\", \"OPENSSL_NO_BUF_FREELISTS\"))"); + println!("cargo:rustc-check-cfg=cfg(osslconf, values(\"OPENSSL_NO_OCB\", \"OPENSSL_NO_SM4\", \"OPENSSL_NO_SEED\", \"OPENSSL_NO_CHACHA\", \"OPENSSL_NO_CAST\", \"OPENSSL_NO_IDEA\", \"OPENSSL_NO_CAMELLIA\", \"OPENSSL_NO_RC4\", \"OPENSSL_NO_BF\", \"OPENSSL_NO_PSK\", \"OPENSSL_NO_DEPRECATED_3_0\", \"OPENSSL_NO_SCRYPT\", \"OPENSSL_NO_SM3\", \"OPENSSL_NO_RMD160\", \"OPENSSL_NO_EC2M\", \"OPENSSL_NO_OCSP\", \"OPENSSL_NO_CMS\", \"OPENSSL_NO_COMP\", \"OPENSSL_NO_SOCK\", \"OPENSSL_NO_STDIO\", \"OPENSSL_NO_EC\", \"OPENSSL_NO_SSL3_METHOD\", \"OPENSSL_NO_KRB5\", \"OPENSSL_NO_TLSEXT\", \"OPENSSL_NO_SRP\", \"OPENSSL_NO_RFC3779\", \"OPENSSL_NO_SHA\", \"OPENSSL_NO_NEXTPROTONEG\", \"OPENSSL_NO_ENGINE\", \"OPENSSL_NO_BUF_FREELISTS\"))"); println!("cargo:rustc-check-cfg=cfg(openssl)"); println!("cargo:rustc-check-cfg=cfg(libressl)"); diff --git a/openssl-sys/build/run_bindgen.rs b/openssl-sys/build/run_bindgen.rs index db31cbb63..27bd482b3 100644 --- a/openssl-sys/build/run_bindgen.rs +++ b/openssl-sys/build/run_bindgen.rs @@ -64,7 +64,7 @@ const INCLUDES: &str = " #include #endif -#if OPENSSL_VERSION_NUMBER >= 0x30200000 && defined(OPENSSL_THREADS) +#if OPENSSL_VERSION_NUMBER >= 0x30200000 #include #endif "; diff --git a/openssl-sys/src/handwritten/mod.rs b/openssl-sys/src/handwritten/mod.rs index 35776486d..47b3360fd 100644 --- a/openssl-sys/src/handwritten/mod.rs +++ b/openssl-sys/src/handwritten/mod.rs @@ -29,7 +29,7 @@ pub use self::sha::*; pub use self::srtp::*; pub use self::ssl::*; pub use self::stack::*; -#[cfg(all(ossl320, osslconf = "OPENSSL_THREADS"))] +#[cfg(ossl320)] pub use self::thread::*; pub use self::tls1::*; pub use self::types::*; @@ -68,7 +68,7 @@ mod sha; mod srtp; mod ssl; mod stack; -#[cfg(all(ossl320, osslconf = "OPENSSL_THREADS"))] +#[cfg(ossl320)] mod thread; mod tls1; mod types; diff --git a/systest/build.rs b/systest/build.rs index dde28b500..fc970f410 100644 --- a/systest/build.rs +++ b/systest/build.rs @@ -86,7 +86,6 @@ fn main() { cfg.header("openssl/provider.h"); } if version >= 0x30200000 { - // thread is present as a header even if OPENSSL_THREADS is not defined cfg.header("openssl/thread.h"); } }