-
Notifications
You must be signed in to change notification settings - Fork 380
Closed
Description
#[cxx::bridge]
mod ffi {
#[repr(align(4))]
struct S {
b: [u8; 4],
}
}
Expected C++ header:
struct alignas(4) S {
std::array<std::uint8_t, 4> b;
};
- Rust reference: https://doc.rust-lang.org/1.51.0/reference/type-layout.html#the-alignment-modifiers
- C++ reference: https://en.cppreference.com/w/cpp/language/alignas
Currently the C++ code generator just errors on this attribute.
error[cxxbridge]: unrecognized repr
┌─ src/main.rs:3:12
│
3 │ #[repr(align(4))]
│ ^^^^^^^^ unrecognized repr
nikita240
Metadata
Metadata
Assignees
Labels
No labels