-
Notifications
You must be signed in to change notification settings - Fork 369
Open
Description
On Rust,
#[repr(i32)
pub enum MyEnum {
EnumA,
EnumB,
}
The generated C header is wrong (with duplicated definitions):
enum MyEnum {
EnumA,
EnumB
};
typedef int32_t MyEnum;
To fix the duplicated definitions, the C header should be like this:
enum {
EnumA,
EnumB
};
typedef int32_t MyEnum;
In additional, with cpp_compat = true, the C/C++ compatible header should be like this:
enum
#ifdef __cplusplus
MyEnum : int32_t
#endif // __cplusplus
{
EnumA,
EnumB
};
#ifndef __cplusplus
typedef int32_t MyEnum;
#endif // __cplusplus
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels