Skip to content

Fix name of the dispatch_queue_create_with_target#120

Merged
simlay merged 1 commit into
RustAudio:masterfrom
indutny-signal:fix/dispatch-queue-names
Jun 4, 2026
Merged

Fix name of the dispatch_queue_create_with_target#120
simlay merged 1 commit into
RustAudio:masterfrom
indutny-signal:fix/dispatch-queue-names

Conversation

@indutny-signal

Copy link
Copy Markdown
Contributor

dispatch_queue_create_with_target is defined with DISPATCH_ALIAS_V2 macro that adds a _$V2 to the symbol name. However when trust_clang_mangling(false) is configured for the builder, bindgen fails to recognize that.

Diff between generated files:

diff --git a/tmp/old.rs b/tmp/new.rs
index a07b6c0..207b79b 100644
--- a/tmp/old.rs
+++ b/tmp/new.rs
@@ -7256,6 +7256,7 @@ unsafe extern "C" {
     pub fn rand_r(arg1: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
 }
 unsafe extern "C" {
+    #[link_name = "\u{1}_realpath$DARWIN_EXTSN"]
     pub fn realpath(
         arg1: *const ::std::os::raw::c_char,
         arg2: *mut ::std::os::raw::c_char,
@@ -14340,6 +14341,7 @@ unsafe extern "C" {
     ) -> dispatch_queue_attr_t;
 }
 unsafe extern "C" {
+    #[link_name = "\u{1}_dispatch_queue_create_with_target$V2"]
     pub fn dispatch_queue_create_with_target(
         label: *const ::std::os::raw::c_char,
         attr: dispatch_queue_attr_t,
@@ -14427,12 +14429,14 @@ unsafe extern "C" {
     -> *mut ::std::os::raw::c_void;
 }
 unsafe extern "C" {
+    #[link_name = "\u{1}_dispatch_assert_queue$V2"]
     pub fn dispatch_assert_queue(queue: dispatch_queue_t);
 }
 unsafe extern "C" {
     pub fn dispatch_assert_queue_barrier(queue: dispatch_queue_t);
 }
 unsafe extern "C" {
+    #[link_name = "\u{1}_dispatch_assert_queue_not$V2"]
     pub fn dispatch_assert_queue_not(queue: dispatch_queue_t);
 }
 unsafe extern "C" {

`dispatch_queue_create_with_target` is defined with `DISPATCH_ALIAS_V2`
macro that adds a `_$V2` to the symbol name. However when
`trust_clang_mangling(false)` is configured for the builder, bindgen
fails to recognize that.

Diff between generated files:

    diff --git a/tmp/old.rs b/tmp/new.rs
    index a07b6c0..207b79b 100644
    --- a/tmp/old.rs
    +++ b/tmp/new.rs
    @@ -7256,6 +7256,7 @@ unsafe extern "C" {
         pub fn rand_r(arg1: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
     }
     unsafe extern "C" {
    +    #[link_name = "\u{1}_realpath$DARWIN_EXTSN"]
         pub fn realpath(
             arg1: *const ::std::os::raw::c_char,
             arg2: *mut ::std::os::raw::c_char,
    @@ -14340,6 +14341,7 @@ unsafe extern "C" {
         ) -> dispatch_queue_attr_t;
     }
     unsafe extern "C" {
    +    #[link_name = "\u{1}_dispatch_queue_create_with_target$V2"]
         pub fn dispatch_queue_create_with_target(
             label: *const ::std::os::raw::c_char,
             attr: dispatch_queue_attr_t,
    @@ -14427,12 +14429,14 @@ unsafe extern "C" {
         -> *mut ::std::os::raw::c_void;
     }
     unsafe extern "C" {
    +    #[link_name = "\u{1}_dispatch_assert_queue$V2"]
         pub fn dispatch_assert_queue(queue: dispatch_queue_t);
     }
     unsafe extern "C" {
         pub fn dispatch_assert_queue_barrier(queue: dispatch_queue_t);
     }
     unsafe extern "C" {
    +    #[link_name = "\u{1}_dispatch_assert_queue_not$V2"]
         pub fn dispatch_assert_queue_not(queue: dispatch_queue_t);
     }
     unsafe extern "C" {
@indutny-signal

Copy link
Copy Markdown
Contributor Author

FWIW, this hits us through mozilla/cubeb-coreaudio-rs. Apparently the symbol is present on macOS, but is not considered "documented" by Apple's App Store review team.

I'd appreciate it if you could merge this and cut release for us. ❤️

@simlay

simlay commented Jun 4, 2026

Copy link
Copy Markdown
Member

I'd appreciate it if you could merge this and cut release for us. ❤️

Will do!

@simlay simlay merged commit 0437958 into RustAudio:master Jun 4, 2026
10 checks passed
@simlay simlay mentioned this pull request Jun 4, 2026
@indutny-signal

Copy link
Copy Markdown
Contributor Author

Thank you, you are the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants