Skip to content
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

fix: update extern "C" to extern "C-unwind" in multiple files #105

Merged
merged 1 commit into from
Nov 12, 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
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;
}
11 changes: 6 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,18 @@ 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
Loading