Closed
Description
I have a case where I need to convert some headers which contain binary blob arrays.
Bindgen only generates their name. Below I have a minimal example.
Input C/C++ Header
static const unsigned char data[] = {
0x01, 0x02, 0x03, 0x04
};
Bindgen Invocation
$ bindgen input.h
Actual Results
/* automatically generated by rust-bindgen */
extern "C" {
#[link_name = "\u{1}data"]
pub static mut data: [::std::os::raw::c_uchar; 4usize];
}
Expected Results
I'm not sure what would be the best result, but something similar to:
pub const data: [::std::os::raw::c_uchar; 4usize] = [0x01, 0x02, 0x03, 0x04];
Activity
emilio commentedon Feb 21, 2019
Dupe of #1266. We have no way of accessing this information from clang atm.
Adding such an API to libclang shouldn't be too hard, if someone was motivated enough. I'm happy to help out with that, but I doubt I'd have enough time to do it myself.