autocxx icon indicating copy to clipboard operation
autocxx copied to clipboard

Support arrays

Open adetaylor opened this issue 4 years ago • 2 comments

Got

 thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(MacroParseFail(Conversion(UnsupportedType("[u64 ; 4usize]"))))', demo/build.rs:23:92

from these bindgen bindings:

              #[inline]
              pub unsafe fn set_fail_intercept(&mut self, fail_intercept: [u64; 4usize]) {
                  set_fail_intercept(self, fail_intercept)
              }

(for example. Probably many other cases)

adetaylor avatar Mar 17 '21 04:03 adetaylor

#967 shows how cxx supports arrays.

adetaylor avatar Mar 28 '22 16:03 adetaylor

Sitrep: Arrays still unsupported. Lots of demand!

Current behavior:

inline std::array<uint8_t, 6> getIVs()
{
    std::array<uint8_t, 6> myarray = { 0, 1, 2, 3};
    return myarray;
}

results in bindgen giving us this:

     extern "C" {
         #[cpp_semantics(incomprehensible_param_in_arg_or_return)]
         #[link_name = "\u{1}__Z6getIVsv"]
         pub fn getIVs() -> [u8; 6usize];
     }

adetaylor avatar Nov 22 '23 12:11 adetaylor