Skip to content

Commit

Permalink
fix: update extern "C" to extern "C-unwind" in multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
inflation committed Oct 22, 2024
1 parent 3776f64 commit 6ae141c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion jpegxl-sys/src/color/cms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ along with jpegxl-sys. If not, see <https://www.gnu.org/licenses/>.
use super::cms_interface::JxlCmsInterface;

extern "C" {
extern "C-unwind" {
pub fn JxlGetDefaultCms() -> *const JxlCmsInterface;
}
10 changes: 5 additions & 5 deletions jpegxl-sys/src/color/cms_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::common::types::JxlBool;

use super::color_encoding::JxlColorEncoding;

pub type JpegXlCmsSetFieldsFromIccFunc = extern "C" fn(
pub type JpegXlCmsSetFieldsFromIccFunc = extern "C-unwind" fn(
user_data: *mut c_void,
icc_data: *const u8,
icc_size: usize,
Expand All @@ -51,7 +51,7 @@ pub struct JxlColorProfile {
pub num_channels: usize,
}

pub type JpegXlCmsInitFunc = extern "C" fn(
pub type JpegXlCmsInitFunc = extern "C-unwind" fn(
init_data: *mut c_void,
num_threads: usize,
pixels_per_thread: usize,
Expand All @@ -60,17 +60,17 @@ pub type JpegXlCmsInitFunc = extern "C" fn(
intensity_target: f32,
) -> *mut c_void;

pub type JpegXlCmsGetBufferFunc = extern "C" fn(user_data: *mut c_void, thread: usize) -> *mut f32;
pub type JpegXlCmsGetBufferFunc = extern "C-unwind" fn(user_data: *mut c_void, thread: usize) -> *mut f32;

pub type JpegXlCmsRunFunc = extern "C" fn(
pub type JpegXlCmsRunFunc = extern "C-unwind" fn(
user_data: *mut c_void,
thread: usize,
input_buffer: *const f32,
output_buffer: *mut f32,
num_pixels: usize,
) -> JxlBool;

pub type JpegXlCmsDestroyFun = extern "C" fn(user_data: *mut c_void);
pub type JpegXlCmsDestroyFun = extern "C-unwind" fn(user_data: *mut c_void);

#[repr(C)]
#[derive(Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion jpegxl-sys/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub type JxlImageOutRunCallback = extern "C" fn(
/// - `run_opaque`: user data returned by the [`init`](JxlImageOutInitCallback) callback.
pub type JxlImageOutDestroyCallback = extern "C" fn(run_opaque: *mut c_void);

extern "C" {
extern "C-unwind" {
/// Decoder library version.
///
/// # Returns
Expand Down
2 changes: 1 addition & 1 deletion jpegxl-sys/src/encoder/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ pub type JxlDebugImageCallback = extern "C-unwind" fn(
pixels: *const u16,
);

extern "C" {
extern "C-unwind" {
/// Encoder library version.
///
/// # Returns
Expand Down
2 changes: 1 addition & 1 deletion jpegxl-sys/src/encoder/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct JxlEncoderStats {
_unused: [u8; 0],
}

extern "C" {
extern "C-unwind" {
/// Creates an instance of [`JxlEncoderStats`] and initializes it.
///
/// # Returns
Expand Down
2 changes: 1 addition & 1 deletion jpegxl-sys/src/metadata/compressed_icc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ along with jpegxl-sys. If not, see <https://www.gnu.org/licenses/>.
use crate::common::{memory_manager, types::JxlBool};

extern "C" {
extern "C-unwind" {
/// Allocates a buffer using the memory manager, fills it with a compressed
/// representation of an ICC profile, returns the result through `output_buffer`
/// and indicates its size through `output_size`.
Expand Down
2 changes: 1 addition & 1 deletion jpegxl-sys/src/metadata/gain_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub struct JxlGainMapBundle {
pub gain_map: *const u8,
}

extern "C" {
extern "C-unwind" {
/// Calculates the total size required to serialize the gain map bundle into a
/// binary buffer. This function accounts for all the necessary space to
/// serialize fields such as gain map metadata, color encoding, compressed ICC
Expand Down

0 comments on commit 6ae141c

Please sign in to comment.