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 one argument block pointer issue, #1378 #1519

Merged
merged 1 commit into from
Feb 11, 2019
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 src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3961,7 +3961,7 @@ mod utils {
};

quote! {
*const ::block::Block<(#(#args),*), #ret_ty>
*const ::block::Block<(#(#args,)*), #ret_ty>
}
}
}
13 changes: 9 additions & 4 deletions tests/expectations/tests/blocks-signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,19 @@
extern crate block;
extern "C" {
#[link_name = "\u{1}_Z8atexit_bU13block_pointerFvvE"]
pub fn atexit_b(arg1: _bindgen_ty_id_20);
pub fn atexit_b(arg1: _bindgen_ty_id_25);
}
pub type dispatch_data_t = *mut ::std::os::raw::c_void;
pub type dispatch_data_applier_t = _bindgen_ty_id_27;
pub type dispatch_data_applier_t = _bindgen_ty_id_32;
extern "C" {
#[link_name = "\u{1}_Z19dispatch_data_applyPvU13block_pointerFbS_yPKvyE"]
pub fn dispatch_data_apply(data: dispatch_data_t, applier: dispatch_data_applier_t) -> bool;
}
pub type _bindgen_ty_id_20 = *const ::block::Block<(), ()>;
pub type _bindgen_ty_id_27 =
extern "C" {
#[link_name = "\u{1}_Z3fooU13block_pointerFvyE"]
pub fn foo(arg1: _bindgen_ty_id_42) -> bool;
}
pub type _bindgen_ty_id_25 = *const ::block::Block<(), ()>;
pub type _bindgen_ty_id_32 =
*const ::block::Block<(dispatch_data_t, usize, *const ::std::os::raw::c_void, usize), bool>;
pub type _bindgen_ty_id_42 = *const ::block::Block<(usize,), ()>;
4 changes: 4 additions & 0 deletions tests/expectations/tests/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ extern "C" {
#[link_name = "\u{1}_Z19dispatch_data_applyPvU13block_pointerFbS_yPKvyE"]
pub fn dispatch_data_apply(data: dispatch_data_t, applier: dispatch_data_applier_t) -> bool;
}
extern "C" {
#[link_name = "\u{1}_Z3fooU13block_pointerFvyE"]
pub fn foo(arg1: *mut ::std::os::raw::c_void) -> bool;
}
4 changes: 3 additions & 1 deletion tests/headers/blocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ typedef bool (^dispatch_data_applier_t)(dispatch_data_t region,
size_t size);

bool dispatch_data_apply(dispatch_data_t data,
dispatch_data_applier_t applier);
dispatch_data_applier_t applier);

bool foo(void (^)(size_t bar));