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 C++ types that are not structs #13

Closed
dtolnay opened this issue Jan 21, 2020 · 1 comment · Fixed by #15
Closed

Support opaque C++ types that are not structs #13

dtolnay opened this issue Jan 21, 2020 · 1 comment · Fixed by #15

Comments

@dtolnay
Copy link
Owner

dtolnay commented Jan 21, 2020

For example we might have:

// c++

using Obj = void*;
// rust

#[cxx::bridge]
mod ffi {
    extern "C" {
        type Obj;
        fn f(obj: &Obj);
    }
}

Currently this fails to compile because we forward declare opaque C types assuming they are structs.

target/debug/build/cxxtest/out/src/main.rs.cc:5:8: error: using typedef-name ‘using Obj = void*’ after ‘struct’
    5 | struct Obj;
      |        ^~~
@notgull
Copy link

notgull commented Jan 21, 2020

Where does the code parse opaque C types at the moment? I’d like to try to take this issue on.

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 a pull request may close this issue.

2 participants