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 opaque types that are not structs #15

Merged
merged 1 commit into from
Jan 21, 2020
Merged

Support opaque types that are not structs #15

merged 1 commit into from
Jan 21, 2020

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Jan 21, 2020

Fixes #13.

This way we can have:

// c++

using Obj = void*;
// rust

#[cxx::bridge]
mod ffi {
    extern "C" {
        include!("...");

        type Obj;
        fn f(obj: &Obj);
    }
}

We no longer assume anything about opaque C++ types except that something with the right name has been declared by one of the header(s).

cc @not-a-seagull

@notgull
Copy link

notgull commented Jan 21, 2020

Well you're fast... 😄

I think this would solve the problem I've been having.

@dtolnay dtolnay merged commit 270b885 into master Jan 21, 2020
@dtolnay dtolnay deleted the opaque branch January 21, 2020 02:50
@dtolnay
Copy link
Owner Author

dtolnay commented Jan 21, 2020

I published 0.1.2 containing this fix.

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.

Support opaque C++ types that are not structs
2 participants