Skip to content

Use the "C-unwind" abi for functions we cannot guarantee won't panic #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 49 additions & 41 deletions libz-rs-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub type z_off_t = c_long;
/// }
/// ```
#[export_name = prefix!(crc32)]
pub unsafe extern "C" fn crc32(crc: c_ulong, buf: *const Bytef, len: uInt) -> c_ulong {
pub unsafe extern "C-unwind" fn crc32(crc: c_ulong, buf: *const Bytef, len: uInt) -> c_ulong {
match unsafe { slice_from_raw_parts(buf, len as usize) } {
Some(buf) => zlib_rs::crc32(crc as u32, buf) as c_ulong,
None => 0,
Expand Down Expand Up @@ -131,7 +131,7 @@ pub unsafe extern "C" fn crc32(crc: c_ulong, buf: *const Bytef, len: uInt) -> c_
/// }
/// ```
#[export_name = prefix!(crc32_combine)]
pub extern "C" fn crc32_combine(crc1: c_ulong, crc2: c_ulong, len2: z_off_t) -> c_ulong {
pub extern "C-unwind" fn crc32_combine(crc1: c_ulong, crc2: c_ulong, len2: z_off_t) -> c_ulong {
zlib_rs::crc32_combine(crc1 as u32, crc2 as u32, len2 as u64) as c_ulong
}

Expand Down Expand Up @@ -161,7 +161,7 @@ pub extern "C" fn crc32_combine(crc1: c_ulong, crc2: c_ulong, len2: z_off_t) ->
/// }
/// ```
#[export_name = prefix!(adler32)]
pub unsafe extern "C" fn adler32(adler: c_ulong, buf: *const Bytef, len: uInt) -> c_ulong {
pub unsafe extern "C-unwind" fn adler32(adler: c_ulong, buf: *const Bytef, len: uInt) -> c_ulong {
match unsafe { slice_from_raw_parts(buf, len as usize) } {
Some(buf) => zlib_rs::adler32(adler as u32, buf) as c_ulong,
None => 1,
Expand Down Expand Up @@ -196,7 +196,11 @@ pub unsafe extern "C" fn adler32(adler: c_ulong, buf: *const Bytef, len: uInt) -
/// }
/// ```
#[export_name = prefix!(adler32_combine)]
pub extern "C" fn adler32_combine(adler1: c_ulong, adler2: c_ulong, len2: z_off_t) -> c_ulong {
pub extern "C-unwind" fn adler32_combine(
adler1: c_ulong,
adler2: c_ulong,
len2: z_off_t,
) -> c_ulong {
match u64::try_from(len2) {
Ok(len2) => zlib_rs::adler32_combine(adler1 as u32, adler2 as u32, len2) as c_ulong,
Err(_) => {
Expand Down Expand Up @@ -262,7 +266,7 @@ pub extern "C" fn adler32_combine(adler1: c_ulong, adler2: c_ulong, len2: z_off_
/// assert_eq!(dest, b"Ferris");
/// ```
#[export_name = prefix!(uncompress)]
pub unsafe extern "C" fn uncompress(
pub unsafe extern "C-unwind" fn uncompress(
dest: *mut u8,
destLen: *mut c_ulong,
source: *const u8,
Expand Down Expand Up @@ -311,7 +315,7 @@ pub unsafe extern "C" fn uncompress(
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflate)]
pub unsafe extern "C" fn inflate(strm: *mut z_stream, flush: i32) -> i32 {
pub unsafe extern "C-unwind" fn inflate(strm: *mut z_stream, flush: i32) -> i32 {
if let Some(stream) = InflateStream::from_stream_mut(strm) {
let flush = InflateFlush::try_from(flush).unwrap_or_default();
zlib_rs::inflate::inflate(stream, flush) as _
Expand All @@ -335,7 +339,7 @@ pub unsafe extern "C" fn inflate(strm: *mut z_stream, flush: i32) -> i32 {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateEnd)]
pub unsafe extern "C" fn inflateEnd(strm: *mut z_stream) -> i32 {
pub unsafe extern "C-unwind" fn inflateEnd(strm: *mut z_stream) -> i32 {
match InflateStream::from_stream_mut(strm) {
Some(stream) => {
zlib_rs::inflate::end(stream);
Expand Down Expand Up @@ -369,7 +373,7 @@ pub unsafe extern "C" fn inflateEnd(strm: *mut z_stream) -> i32 {
/// - `zfree`
/// - `opaque`
#[export_name = prefix!(inflateBackInit_)]
pub unsafe extern "C" fn inflateBackInit_(
pub unsafe extern "C-unwind" fn inflateBackInit_(
_strm: z_streamp,
_windowBits: c_int,
_window: *mut c_uchar,
Expand All @@ -389,7 +393,7 @@ pub unsafe extern "C" fn inflateBackInit_(
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateBackInit_`]
#[export_name = prefix!(inflateBack)]
pub unsafe extern "C" fn inflateBack(
pub unsafe extern "C-unwind" fn inflateBack(
_strm: z_streamp,
_in: in_func,
_in_desc: *mut c_void,
Expand All @@ -416,7 +420,7 @@ pub unsafe extern "C" fn inflateBack(
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateBackInit_`]
#[export_name = prefix!(inflateBackEnd)]
pub unsafe extern "C" fn inflateBackEnd(_strm: z_streamp) -> c_int {
pub unsafe extern "C-unwind" fn inflateBackEnd(_strm: z_streamp) -> c_int {
todo!("inflateBack is not implemented yet")
}

Expand Down Expand Up @@ -445,7 +449,7 @@ pub unsafe extern "C" fn inflateBackEnd(_strm: z_streamp) -> c_int {
/// - `source` is `NULL`
/// - `source` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateCopy)]
pub unsafe extern "C" fn inflateCopy(dest: *mut z_stream, source: *const z_stream) -> i32 {
pub unsafe extern "C-unwind" fn inflateCopy(dest: *mut z_stream, source: *const z_stream) -> i32 {
let Some(dest) = (unsafe { dest.cast::<MaybeUninit<InflateStream>>().as_mut() }) else {
return ReturnCode::StreamError as _;
};
Expand Down Expand Up @@ -480,7 +484,7 @@ pub unsafe extern "C" fn inflateCopy(dest: *mut z_stream, source: *const z_strea
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateMark)]
pub unsafe extern "C" fn inflateMark(strm: *const z_stream) -> c_long {
pub unsafe extern "C-unwind" fn inflateMark(strm: *const z_stream) -> c_long {
if let Some(stream) = InflateStream::from_stream_ref(strm) {
zlib_rs::inflate::mark(stream)
} else {
Expand Down Expand Up @@ -514,7 +518,7 @@ pub unsafe extern "C" fn inflateMark(strm: *const z_stream) -> c_long {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateSync)]
pub unsafe extern "C" fn inflateSync(strm: *mut z_stream) -> i32 {
pub unsafe extern "C-unwind" fn inflateSync(strm: *mut z_stream) -> i32 {
if let Some(stream) = InflateStream::from_stream_mut(strm) {
zlib_rs::inflate::sync(stream) as _
} else {
Expand All @@ -531,7 +535,7 @@ pub unsafe extern "C" fn inflateSync(strm: *mut z_stream) -> i32 {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateSyncPoint)]
pub unsafe extern "C" fn inflateSyncPoint(strm: *mut z_stream) -> i32 {
pub unsafe extern "C-unwind" fn inflateSyncPoint(strm: *mut z_stream) -> i32 {
if let Some(stream) = InflateStream::from_stream_mut(strm) {
zlib_rs::inflate::sync_point(stream) as i32
} else {
Expand Down Expand Up @@ -565,7 +569,7 @@ pub unsafe extern "C" fn inflateSyncPoint(strm: *mut z_stream) -> i32 {
/// - `zfree`
/// - `opaque`
#[export_name = prefix!(inflateInit_)]
pub unsafe extern "C" fn inflateInit_(
pub unsafe extern "C-unwind" fn inflateInit_(
strm: z_streamp,
version: *const c_char,
stream_size: c_int,
Expand Down Expand Up @@ -598,7 +602,7 @@ pub unsafe extern "C" fn inflateInit_(
/// - `zfree`
/// - `opaque`
#[export_name = prefix!(inflateInit2_)]
pub unsafe extern "C" fn inflateInit2_(
pub unsafe extern "C-unwind" fn inflateInit2_(
strm: z_streamp,
windowBits: c_int,
version: *const c_char,
Expand All @@ -624,7 +628,7 @@ pub unsafe extern "C" fn inflateInit2_(
/// - `zalloc`
/// - `zfree`
/// - `opaque`
unsafe extern "C" fn inflateInit2(strm: z_streamp, windowBits: c_int) -> c_int {
unsafe extern "C-unwind" fn inflateInit2(strm: z_streamp, windowBits: c_int) -> c_int {
let Some(strm) = (unsafe { strm.as_mut() }) else {
return ReturnCode::StreamError as _;
};
Expand Down Expand Up @@ -659,7 +663,7 @@ unsafe extern "C" fn inflateInit2(strm: z_streamp, windowBits: c_int) -> c_int {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflatePrime)]
pub unsafe extern "C" fn inflatePrime(strm: *mut z_stream, bits: i32, value: i32) -> i32 {
pub unsafe extern "C-unwind" fn inflatePrime(strm: *mut z_stream, bits: i32, value: i32) -> i32 {
if let Some(stream) = InflateStream::from_stream_mut(strm) {
zlib_rs::inflate::prime(stream, bits, value) as _
} else {
Expand All @@ -685,7 +689,7 @@ pub unsafe extern "C" fn inflatePrime(strm: *mut z_stream, bits: i32, value: i32
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateReset)]
pub unsafe extern "C" fn inflateReset(strm: *mut z_stream) -> i32 {
pub unsafe extern "C-unwind" fn inflateReset(strm: *mut z_stream) -> i32 {
if let Some(stream) = InflateStream::from_stream_mut(strm) {
zlib_rs::inflate::reset(stream) as _
} else {
Expand All @@ -712,7 +716,7 @@ pub unsafe extern "C" fn inflateReset(strm: *mut z_stream) -> i32 {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateReset2)]
pub unsafe extern "C" fn inflateReset2(strm: *mut z_stream, windowBits: c_int) -> i32 {
pub unsafe extern "C-unwind" fn inflateReset2(strm: *mut z_stream, windowBits: c_int) -> i32 {
if let Some(stream) = InflateStream::from_stream_mut(strm) {
let config = InflateConfig {
window_bits: windowBits,
Expand Down Expand Up @@ -751,7 +755,7 @@ pub unsafe extern "C" fn inflateReset2(strm: *mut z_stream, windowBits: c_int) -
/// - `dictionary` is `NULL`
/// - `dictionary` and `dictLength` satisfy the requirements of [`core::slice::from_raw_parts_mut::<u8>`]
#[export_name = prefix!(inflateSetDictionary)]
pub unsafe extern "C" fn inflateSetDictionary(
pub unsafe extern "C-unwind" fn inflateSetDictionary(
strm: *mut z_stream,
dictionary: *const u8,
dictLength: c_uint,
Expand Down Expand Up @@ -809,7 +813,7 @@ pub unsafe extern "C" fn inflateSetDictionary(
/// - if `head.name` is not NULL, it must be writable for at least `head.name_max` bytes
/// - if `head.comment` is not NULL, it must be writable for at least `head.comm_max` bytes
#[export_name = prefix!(inflateGetHeader)]
pub unsafe extern "C" fn inflateGetHeader(strm: z_streamp, head: gz_headerp) -> c_int {
pub unsafe extern "C-unwind" fn inflateGetHeader(strm: z_streamp, head: gz_headerp) -> c_int {
let Some(stream) = (unsafe { InflateStream::from_stream_mut(strm) }) else {
return ReturnCode::StreamError as _;
};
Expand All @@ -829,7 +833,7 @@ pub unsafe extern "C" fn inflateGetHeader(strm: z_streamp, head: gz_headerp) ->
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateUndermine)]
pub unsafe extern "C" fn inflateUndermine(strm: *mut z_stream, subvert: i32) -> c_int {
pub unsafe extern "C-unwind" fn inflateUndermine(strm: *mut z_stream, subvert: i32) -> c_int {
if let Some(stream) = InflateStream::from_stream_mut(strm) {
zlib_rs::inflate::undermine(stream, subvert) as i32
} else {
Expand All @@ -844,7 +848,7 @@ pub unsafe extern "C" fn inflateUndermine(strm: *mut z_stream, subvert: i32) ->
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`inflateInit_`] or similar
#[export_name = prefix!(inflateResetKeep)]
pub unsafe extern "C" fn inflateResetKeep(strm: *mut z_stream) -> c_int {
pub unsafe extern "C-unwind" fn inflateResetKeep(strm: *mut z_stream) -> c_int {
if let Some(stream) = InflateStream::from_stream_mut(strm) {
zlib_rs::inflate::reset_keep(stream) as _
} else {
Expand All @@ -863,7 +867,7 @@ pub unsafe extern "C" fn inflateResetKeep(strm: *mut z_stream) -> c_int {
/// - `buf` is `NULL`
/// - `buf` and `len` satisfy the requirements of [`core::slice::from_raw_parts`]
#[export_name = prefix!(inflateCodesUsed)]
pub unsafe extern "C" fn inflateCodesUsed(_strm: *mut z_stream) -> c_ulong {
pub unsafe extern "C-unwind" fn inflateCodesUsed(_strm: *mut z_stream) -> c_ulong {
todo!()
}

Expand All @@ -884,7 +888,7 @@ pub unsafe extern "C" fn inflateCodesUsed(_strm: *mut z_stream) -> c_ulong {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`deflateInit_`] or similar
#[export_name = prefix!(deflate)]
pub unsafe extern "C" fn deflate(strm: *mut z_stream, flush: i32) -> c_int {
pub unsafe extern "C-unwind" fn deflate(strm: *mut z_stream, flush: i32) -> c_int {
if let Some(stream) = DeflateStream::from_stream_mut(strm) {
match DeflateFlush::try_from(flush) {
Ok(flush) => zlib_rs::deflate::deflate(stream, flush) as _,
Expand Down Expand Up @@ -918,7 +922,7 @@ pub unsafe extern "C" fn deflate(strm: *mut z_stream, flush: i32) -> c_int {
/// - `head` is `NULL`
/// - `head` satisfies the requirements of `&mut *head`
#[export_name = prefix!(deflateSetHeader)]
pub unsafe extern "C" fn deflateSetHeader(strm: *mut z_stream, head: gz_headerp) -> c_int {
pub unsafe extern "C-unwind" fn deflateSetHeader(strm: *mut z_stream, head: gz_headerp) -> c_int {
let Some(stream) = (unsafe { DeflateStream::from_stream_mut(strm) }) else {
return ReturnCode::StreamError as _;
};
Expand All @@ -944,7 +948,7 @@ pub unsafe extern "C" fn deflateSetHeader(strm: *mut z_stream, head: gz_headerp)
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`deflateInit_`] or similar
#[export_name = prefix!(deflateBound)]
pub unsafe extern "C" fn deflateBound(strm: *mut z_stream, sourceLen: c_ulong) -> c_ulong {
pub unsafe extern "C-unwind" fn deflateBound(strm: *mut z_stream, sourceLen: c_ulong) -> c_ulong {
zlib_rs::deflate::bound(DeflateStream::from_stream_mut(strm), sourceLen as usize) as c_ulong
}

Expand Down Expand Up @@ -1001,7 +1005,7 @@ pub unsafe extern "C" fn deflateBound(strm: *mut z_stream, sourceLen: c_ulong) -
/// assert_eq!(dest, [120, 156, 115, 75, 45, 42, 202, 44, 6, 0, 8, 6, 2, 108]);
/// ```
#[export_name = prefix!(compress)]
pub unsafe extern "C" fn compress(
pub unsafe extern "C-unwind" fn compress(
dest: *mut Bytef,
destLen: *mut c_ulong,
source: *const Bytef,
Expand Down Expand Up @@ -1044,7 +1048,7 @@ pub unsafe extern "C" fn compress(
/// - `source` is `NULL`
/// - `source` and `sourceLen` satisfy the requirements of [`core::slice::from_raw_parts`]
#[export_name = prefix!(compress2)]
pub unsafe extern "C" fn compress2(
pub unsafe extern "C-unwind" fn compress2(
dest: *mut Bytef,
destLen: *mut c_ulong,
source: *const Bytef,
Expand Down Expand Up @@ -1077,7 +1081,7 @@ pub unsafe extern "C" fn compress2(
///
/// Can be used before a [`compress`] or [`compress2`] call to allocate the destination buffer.
#[export_name = prefix!(compressBound)]
pub extern "C" fn compressBound(sourceLen: c_ulong) -> c_ulong {
pub extern "C-unwind" fn compressBound(sourceLen: c_ulong) -> c_ulong {
zlib_rs::deflate::compress_bound(sourceLen as usize) as c_ulong
}

Expand All @@ -1099,7 +1103,7 @@ pub extern "C" fn compressBound(sourceLen: c_ulong) -> c_ulong {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`deflateInit_`] or similar
#[export_name = prefix!(deflateEnd)]
pub unsafe extern "C" fn deflateEnd(strm: *mut z_stream) -> i32 {
pub unsafe extern "C-unwind" fn deflateEnd(strm: *mut z_stream) -> i32 {
match DeflateStream::from_stream_mut(strm) {
Some(stream) => match zlib_rs::deflate::end(stream) {
Ok(_) => ReturnCode::Ok as _,
Expand Down Expand Up @@ -1127,7 +1131,7 @@ pub unsafe extern "C" fn deflateEnd(strm: *mut z_stream) -> i32 {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`deflateInit_`] or similar
#[export_name = prefix!(deflateReset)]
pub unsafe extern "C" fn deflateReset(strm: *mut z_stream) -> i32 {
pub unsafe extern "C-unwind" fn deflateReset(strm: *mut z_stream) -> i32 {
match DeflateStream::from_stream_mut(strm) {
Some(stream) => zlib_rs::deflate::reset(stream) as _,
None => ReturnCode::StreamError as _,
Expand Down Expand Up @@ -1158,7 +1162,11 @@ pub unsafe extern "C" fn deflateReset(strm: *mut z_stream) -> i32 {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`deflateInit_`] or similar
#[export_name = prefix!(deflateParams)]
pub unsafe extern "C" fn deflateParams(strm: z_streamp, level: c_int, strategy: c_int) -> c_int {
pub unsafe extern "C-unwind" fn deflateParams(
strm: z_streamp,
level: c_int,
strategy: c_int,
) -> c_int {
let Ok(strategy) = Strategy::try_from(strategy) else {
return ReturnCode::StreamError as _;
};
Expand Down Expand Up @@ -1189,7 +1197,7 @@ pub unsafe extern "C" fn deflateParams(strm: z_streamp, level: c_int, strategy:
/// - `dictionary` is `NULL`
/// - `dictionary` and `dictLength` satisfy the requirements of [`core::slice::from_raw_parts_mut::<u8>`]
#[export_name = prefix!(deflateSetDictionary)]
pub unsafe extern "C" fn deflateSetDictionary(
pub unsafe extern "C-unwind" fn deflateSetDictionary(
strm: z_streamp,
dictionary: *const Bytef,
dictLength: uInt,
Expand Down Expand Up @@ -1225,7 +1233,7 @@ pub unsafe extern "C" fn deflateSetDictionary(
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`deflateInit_`] or similar
#[export_name = prefix!(deflatePrime)]
pub unsafe extern "C" fn deflatePrime(strm: z_streamp, bits: c_int, value: c_int) -> c_int {
pub unsafe extern "C-unwind" fn deflatePrime(strm: z_streamp, bits: c_int, value: c_int) -> c_int {
match DeflateStream::from_stream_mut(strm) {
Some(stream) => zlib_rs::deflate::prime(stream, bits, value) as _,
None => ReturnCode::StreamError as _,
Expand Down Expand Up @@ -1257,7 +1265,7 @@ pub unsafe extern "C" fn deflatePrime(strm: z_streamp, bits: c_int, value: c_int
/// - `bits` is `NULL`
/// - `bits` satisfies the requirements of [`core::ptr::write::<c_int>`]
#[export_name = prefix!(deflatePending)]
pub unsafe extern "C" fn deflatePending(
pub unsafe extern "C-unwind" fn deflatePending(
strm: z_streamp,
pending: *mut c_uint,
bits: *mut c_int,
Expand Down Expand Up @@ -1304,7 +1312,7 @@ pub unsafe extern "C" fn deflatePending(
/// - `source` is `NULL`
/// - `source` satisfies the requirements of `&mut *strm` and was initialized with [`deflateInit_`] or similar
#[export_name = prefix!(deflateCopy)]
pub unsafe extern "C" fn deflateCopy(dest: z_streamp, source: z_streamp) -> c_int {
pub unsafe extern "C-unwind" fn deflateCopy(dest: z_streamp, source: z_streamp) -> c_int {
let Some(dest) = (unsafe { dest.cast::<MaybeUninit<DeflateStream>>().as_mut() }) else {
return ReturnCode::StreamError as _;
};
Expand Down Expand Up @@ -1384,7 +1392,7 @@ pub unsafe extern "C" fn deflateCopy(dest: z_streamp, source: z_streamp) -> c_in
/// let strm = unsafe { strm.assume_init_mut() };
/// ```
#[export_name = prefix!(deflateInit_)]
pub unsafe extern "C" fn deflateInit_(
pub unsafe extern "C-unwind" fn deflateInit_(
strm: z_streamp,
level: c_int,
version: *const c_char,
Expand Down Expand Up @@ -1474,7 +1482,7 @@ pub unsafe extern "C" fn deflateInit_(
/// let strm = unsafe { strm.assume_init_mut() };
/// ```
#[export_name = prefix!(deflateInit2_)]
pub unsafe extern "C" fn deflateInit2_(
pub unsafe extern "C-unwind" fn deflateInit2_(
strm: z_streamp,
level: c_int,
method: c_int,
Expand Down Expand Up @@ -1531,7 +1539,7 @@ pub unsafe extern "C" fn deflateInit2_(
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`deflateInit_`] or similar
#[export_name = prefix!(deflateTune)]
pub unsafe extern "C" fn deflateTune(
pub unsafe extern "C-unwind" fn deflateTune(
strm: z_streamp,
good_length: c_int,
max_lazy: c_int,
Expand Down
Loading
Loading