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

Support different namespaces on different extern blocks #166

Closed
dtolnay opened this issue Apr 28, 2020 · 1 comment
Closed

Support different namespaces on different extern blocks #166

dtolnay opened this issue Apr 28, 2020 · 1 comment

Comments

@dtolnay
Copy link
Owner

dtolnay commented Apr 28, 2020

Currently the namespace is determined globally for an entire #[cxx::bridge] invocation.

#[cxx::bridge(namespace = path::to)]
mod ffi {...}

It would be good to be able to pull in things from multiple different namespaces at once. Something like:

#[cxx::bridge]
mod ffi {
    #[namespace = path::to::first]
    extern "C" {
        type First;
    }

    #[namespace = path::to::second]
    extern "C" {
        type Second;
    }

    #[namespace = path::to::third]
    extern "Rust" {
        fn wow(first: &First, second: &Second);
    }
}
@dtolnay
Copy link
Owner Author

dtolnay commented Oct 30, 2020

Implemented as part of #370.

@dtolnay dtolnay closed this as completed Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant