use #repr(uX) instead of repr(C) for fieldless enums

Otherwise the ABI may differ between the C++ and the Rust
This commit is contained in:
Olivier Goffart 2023-08-31 08:48:15 +02:00 committed by Olivier Goffart
parent f7a44d7dfc
commit 8f16b519a2
9 changed files with 15 additions and 16 deletions

View file

@ -94,7 +94,7 @@ fn builtin_structs(path: &Path) -> anyhow::Result<()> {
writeln!(structs_priv, "#include \"slint_builtin_structs.h\"")?;
writeln!(structs_priv, "#include \"slint_enums_internal.h\"")?;
writeln!(structs_priv, "namespace slint::cbindgen_private {{")?;
writeln!(structs_priv, "enum class KeyEventType;")?;
writeln!(structs_priv, "enum class KeyEventType : uint8_t;")?;
macro_rules! struct_file {
(StandardListViewItem) => {{
writeln!(structs_priv, "using slint::StandardListViewItem;")?;