google / autocxx

Tool for safe ergonomic Rust/C++ interop driven from existing C++ headers
https://docs.rs/autocxx
Apache License 2.0
2.25k stars 144 forks source link

unsupported type error on char typedef #1368

Open fh-igd-mueller-roemer opened 7 months ago

fh-igd-mueller-roemer commented 7 months ago

Describe the bug When a typedef to char is used, autocxx fails with an unsupported type error.

To Reproduce

minimal.h

typedef char Standard_Character;
typedef Standard_Character * Standard_CString;

Standard_CString foo();

main.rs

use autocxx::prelude::*;

include_cpp! {
    #include "minimal.h"
    safety!(unsafe_ffi)
    generate!("foo")
}

fn main() {
    println!("Hello, world!");
}

Cargo.toml and build.rs as shown in the tutorial example.

Expected behavior Code is generated as if char was being used.

Additional context

adetaylor commented 2 months ago

Thanks, please raise a test PR per these instructions