Skip to content

Support different namespaces on different extern blocks #166

Closed
@dtolnay

Description

@dtolnay

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);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions