From 5f21ca8ed59bf5df02a11ee79ae5ddccf6139b4b Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Sat, 7 Jun 2025 12:48:19 +0200 Subject: [PATCH] use `zlibVersion()` instead of a `const` for the version --- src/ffi/c.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/ffi/c.rs b/src/ffi/c.rs index 8b4cc788..14e76906 100644 --- a/src/ffi/c.rs +++ b/src/ffi/c.rs @@ -465,13 +465,6 @@ mod c_backend { pub const MZ_DEFAULT_WINDOW_BITS: c_int = 15; - #[cfg(feature = "zlib-ng")] - const ZLIB_VERSION: &str = "2.1.0.devel\0"; - #[cfg(all(not(feature = "zlib-ng"), feature = "zlib-rs"))] - const ZLIB_VERSION: &str = "1.3.0-zlib-rs-0.5.1\0"; - #[cfg(not(any(feature = "zlib-ng", feature = "zlib-rs")))] - const ZLIB_VERSION: &str = "1.2.8\0"; - pub unsafe extern "C" fn mz_deflateInit2( stream: *mut mz_stream, level: c_int, @@ -487,7 +480,7 @@ mod c_backend { window_bits, mem_level, strategy, - ZLIB_VERSION.as_ptr() as *const c_char, + zlibVersion(), mem::size_of::() as c_int, ) } @@ -495,7 +488,7 @@ mod c_backend { libz::inflateInit2_( stream, window_bits, - ZLIB_VERSION.as_ptr() as *const c_char, + zlibVersion(), mem::size_of::() as c_int, ) }