Skip to content

Commit a9d220a

Browse files
authored
Merge pull request #491 from folkertdev/zlib-version
use `zlibVersion()` instead of a `const` for the version
2 parents ac4d950 + 5f21ca8 commit a9d220a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/ffi/c.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,6 @@ mod c_backend {
465465

466466
pub const MZ_DEFAULT_WINDOW_BITS: c_int = 15;
467467

468-
#[cfg(feature = "zlib-ng")]
469-
const ZLIB_VERSION: &str = "2.1.0.devel\0";
470-
#[cfg(all(not(feature = "zlib-ng"), feature = "zlib-rs"))]
471-
const ZLIB_VERSION: &str = "1.3.0-zlib-rs-0.5.1\0";
472-
#[cfg(not(any(feature = "zlib-ng", feature = "zlib-rs")))]
473-
const ZLIB_VERSION: &str = "1.2.8\0";
474-
475468
pub unsafe extern "C" fn mz_deflateInit2(
476469
stream: *mut mz_stream,
477470
level: c_int,
@@ -487,15 +480,15 @@ mod c_backend {
487480
window_bits,
488481
mem_level,
489482
strategy,
490-
ZLIB_VERSION.as_ptr() as *const c_char,
483+
zlibVersion(),
491484
mem::size_of::<mz_stream>() as c_int,
492485
)
493486
}
494487
pub unsafe extern "C" fn mz_inflateInit2(stream: *mut mz_stream, window_bits: c_int) -> c_int {
495488
libz::inflateInit2_(
496489
stream,
497490
window_bits,
498-
ZLIB_VERSION.as_ptr() as *const c_char,
491+
zlibVersion(),
499492
mem::size_of::<mz_stream>() as c_int,
500493
)
501494
}

0 commit comments

Comments
 (0)