Open afeldman opened 4 years ago
Yeah, std template soup really confuses bindgen sometimes. This could get some work... Generally we're already close-to-libclang-limits when dealing with templates :(
Does anyone have a correct recipe to get these to be ignored?
I currently have
.blocklist_function("strtold")
// qvct, evct, qfcvt_r, ...
.blocklist_function("[a-z]{1,2}cvt(?:_r)?")
// c++ things that aren't supported
.blocklist_item("List_iterator")
.blocklist_type("std::char_traits")
.opaque_type("std_.*")
.blocklist_item("std_basic_string")
.blocklist_item("std_collate.*")
.blocklist_item("__gnu_cxx__min")
I have tried a ton of combinations of blocklist and opaque, but I can't for the life of me get it to not include the following:
pub type std_collate_string_type = std_basic_string<_CharT>;
pub type std_collate_byname_string_type = std_basic_string<_CharT>;
extern "C" {
#[link_name = "\u{1}value"]
pub static std_value: _Tp;
}
extern "C" {
#[link_name = "\u{1}__min"]
pub static __gnu_cxx___min: _Value;
}
extern "C" {
#[link_name = "\u{1}__max"]
pub static __gnu_cxx___max: _Value;
}
I'm hitting this after upgrading to Xcode 14.3:
error[E0412]: cannot find type `_Tp` in this scope
--> bindings.rs:89:27
|
89 | pub static std_value: _Tp;
| ^^^ not found in this scope
I found this issue through Google. FWIW I can get rid of the _Tp
problem with this:
.blocklist_item("std::value")
Does anyone have a correct recipe to get these to be ignored?
I currently have
.blocklist_function("strtold") // qvct, evct, qfcvt_r, ... .blocklist_function("[a-z]{1,2}cvt(?:_r)?") // c++ things that aren't supported .blocklist_item("List_iterator") .blocklist_type("std::char_traits") .opaque_type("std_.*") .blocklist_item("std_basic_string") .blocklist_item("std_collate.*") .blocklist_item("__gnu_cxx__min")
I have tried a ton of combinations of blocklist and opaque, but I can't for the life of me get it to not include the following:
pub type std_collate_string_type = std_basic_string<_CharT>; pub type std_collate_byname_string_type = std_basic_string<_CharT>; extern "C" { #[link_name = "\u{1}value"] pub static std_value: _Tp; } extern "C" { #[link_name = "\u{1}__min"] pub static __gnu_cxx___min: _Value; } extern "C" { #[link_name = "\u{1}__max"] pub static __gnu_cxx___max: _Value; }
.blocklist_file(r"/usr/share/mingw-w64/include/.*")
.blocklist_file(r"/usr/lib/gcc/x86_64-w64-mingw32/.*")
worked for me and excluded all of the items you mentioned.
Does anyone have a correct recipe to get these to be ignored?
I currently have
.blocklist_function("strtold") // qvct, evct, qfcvt_r, ... .blocklist_function("[a-z]{1,2}cvt(?:_r)?") // c++ things that aren't supported .blocklist_item("List_iterator") .blocklist_type("std::char_traits") .opaque_type("std_.*") .blocklist_item("std_basic_string") .blocklist_item("std_collate.*") .blocklist_item("__gnu_cxx__min")
I have tried a ton of combinations of blocklist and opaque, but I can't for the life of me get it to not include the following:
pub type std_collate_string_type = std_basic_string<_CharT>; pub type std_collate_byname_string_type = std_basic_string<_CharT>; extern "C" { #[link_name = "\u{1}value"] pub static std_value: _Tp; } extern "C" { #[link_name = "\u{1}__min"] pub static __gnu_cxx___min: _Value; } extern "C" { #[link_name = "\u{1}__max"] pub static __gnu_cxx___max: _Value; }
On linux what worked for me was:
.blocklist_item("std::value")
.blocklist_item("__gnu_cxx::__min")
.blocklist_item("__gnu_cxx::__max")
Apparently bindgen uses underscores as a replacement for scope resolution operator
I want to build an interface between c++ and rust, but different errors occurred.
Input C/C++ Header
If I rename the types to
seems to help, but then I do not have the functions, containing the std::complex parent class.
Bindgen Invocation
Actual Results