You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Attempting to generate bindings to a class in which a method returns std::array<unsigned char, 6>. Running cargo-expand shows the warning: autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
Preface
The following library typedefs C primitives to other values. Since they match the names of Rust primitives, I have renamed them. u8 to us8, etc.
Specific to this example, us8 is a typedef for unsigned char.
To Reproduce
In a new crate, I created a binding to the file found here. For coverage, I added the include to the PIDToIVState.hpp header as it is a forward declaration along with Method.hpp.
Everything generates correctly except this function:
std::array<us8, 6> getIVs() const
{
return ivs;
}
build.rs
fn main() -> miette::Result<()> {
let dst = cmake::build("PokeFinder/Source/Core");
println!("cargo:rustc-link-search=native={}", dst.display());
println!("cargo:rustc-link-lib=static=PokeFinderCore");
let path = std::path::PathBuf::from("PokeFinder/Source");
let mut b = autocxx_build::Builder::new("src/lib.rs", &[&path]).build()?;
b.flag_if_supported("-std=c++17").compile("pokefinder");
println!("cargo:rerun-if-changed=src/lib.rs");
Ok(())
}
Expected behavior
The function would generate bindings with the returned value of [u8; 6] as shown on this page of cxx. Correct me if I am wrong but unsigned char seems to have no wrapper type and directly converts to u8 (It does this for the getIV function).
Additional context
Changing the return type to unsigned char and uint8_t produces the same result.
The C++ library is built with CMake.
OS: Windows 11
rustc: rustc 1.76.0-nightly (3a85a5cfe 2023-11-20)
Because of the holidays, I have run out of time to make a proper test for this. I will do so as soon as possible. If it could be looked into beforehand, it would be greatly appreciated.
Please advise if any other information is necessary.
The text was updated successfully, but these errors were encountered:
Describe the bug
Attempting to generate bindings to a class in which a method returns
std::array<unsigned char, 6>
. Runningcargo-expand
shows the warning:autocxx bindings couldn't be generated: This function or method uses a type where one of the template parameters was incomprehensible to bindgen/autocxx - probably because it uses template specialization.
Preface
The following library typedefs C primitives to other values. Since they match the names of Rust primitives, I have renamed them. u8 to us8, etc.
Specific to this example,
us8
is a typedef forunsigned char
.To Reproduce
In a new crate, I created a binding to the file found here. For coverage, I added the include to the
PIDToIVState.hpp
header as it is a forward declaration along withMethod.hpp
.Everything generates correctly except this function:
build.rs
lib.rs
Expected behavior
The function would generate bindings with the returned value of [u8; 6] as shown on this page of cxx. Correct me if I am wrong but unsigned char seems to have no wrapper type and directly converts to u8 (It does this for the
getIV
function).Additional context
Changing the return type to
unsigned char
anduint8_t
produces the same result.The C++ library is built with CMake.
OS: Windows 11
rustc:
rustc 1.76.0-nightly (3a85a5cfe 2023-11-20)
Because of the holidays, I have run out of time to make a proper test for this. I will do so as soon as possible. If it could be looked into beforehand, it would be greatly appreciated.
Please advise if any other information is necessary.
The text was updated successfully, but these errors were encountered: