diff --git a/curl-sys/Cargo.toml b/curl-sys/Cargo.toml index dc2728649b..1498d06d49 100644 --- a/curl-sys/Cargo.toml +++ b/curl-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "curl-sys" -version = "0.4.36+curl-7.71.1" +version = "0.4.36+curl-7.72.0" authors = ["Alex Crichton "] links = "curl" build = "build.rs" diff --git a/curl-sys/build.rs b/curl-sys/build.rs index 32c8d3a988..debbfae978 100644 --- a/curl-sys/build.rs +++ b/curl-sys/build.rs @@ -292,6 +292,7 @@ fn main() { .define("HAVE_IOCTLSOCKET_FIONBIO", None) .define("USE_WINSOCK", None) .file("curl/lib/system_win32.c") + .file("curl/lib/version_win32.c") .file("curl/lib/curl_multibyte.c"); if cfg!(feature = "spnego") { diff --git a/curl-sys/curl b/curl-sys/curl index 5a1fc8d338..9d954e49bc 160000 --- a/curl-sys/curl +++ b/curl-sys/curl @@ -1 +1 @@ -Subproject commit 5a1fc8d33808d7b22f57bdf9403cda7ff07b0670 +Subproject commit 9d954e49bce3706a9a2efb119ecd05767f0f2a9e diff --git a/curl-sys/lib.rs b/curl-sys/lib.rs index 108382f977..9f70613687 100644 --- a/curl-sys/lib.rs +++ b/curl-sys/lib.rs @@ -808,7 +808,8 @@ pub const CURLVERSION_FOURTH: CURLversion = 3; pub const CURLVERSION_FIFTH: CURLversion = 4; pub const CURLVERSION_SIXTH: CURLversion = 5; pub const CURLVERSION_SEVENTH: CURLversion = 6; -pub const CURLVERSION_NOW: CURLversion = CURLVERSION_SEVENTH; +pub const CURLVERSION_EIGHTH: CURLversion = 7; +pub const CURLVERSION_NOW: CURLversion = CURLVERSION_EIGHTH; #[repr(C)] pub struct curl_version_info_data { @@ -833,6 +834,8 @@ pub struct curl_version_info_data { pub quic_version: *const c_char, pub cainfo: *const c_char, pub capath: *const c_char, + pub zstd_ver_num: c_uint, + pub zstd_version: *const c_char, } pub const CURL_VERSION_IPV6: c_int = 1 << 0; diff --git a/src/version.rs b/src/version.rs index 8de7cb5da8..baebaaa335 100644 --- a/src/version.rs +++ b/src/version.rs @@ -310,6 +310,30 @@ impl Version { } } } + + /// If avaiable, the numeric zstd version + /// + /// Represented as `(MAJOR << 24) | (MINOR << 12) | PATCH` + pub fn zstd_ver_num(&self) -> Option { + unsafe { + if (*self.inner).age >= curl_sys::CURLVERSION_EIGHTH { + Some((*self.inner).zstd_ver_num) + } else { + None + } + } + } + + /// If available, the human readable version of zstd + pub fn zstd_version(&self) -> Option<&str> { + unsafe { + if (*self.inner).age >= curl_sys::CURLVERSION_EIGHTH { + ::opt_str((*self.inner).zstd_version) + } else { + None + } + } + } } impl fmt::Debug for Version { diff --git a/systest/build.rs b/systest/build.rs index 999f437a83..29b2f6c583 100644 --- a/systest/build.rs +++ b/systest/build.rs @@ -61,6 +61,12 @@ fn main() { }); cfg.skip_const(move |s| { + if version < 72 { + match s { + "CURLVERSION_EIGHTH" => return true, + _ => {} + } + } if version < 70 { match s { "CURL_VERSION_HTTP3"