You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Previously bindgen was picking the 'constified_enum'. E.g it would turn
the luw_srb_flags_t enum
typedef enum {
LUW_SRB_NONE = 0x00,
LUW_SRB_APPEND = 0x01,
LUW_SRB_ALLOC = 0x02,
LUW_SRB_FULL_SIZE = 0x04,
LUW_SRB_FLAGS_ALL = (LUW_SRB_NONE|LUW_SRB_APPEND|LUW_SRB_ALLOC|
LUW_SRB_FULL_SIZE)
} luw_srb_flags_t;
into
pub const luw_srb_flags_t_LUW_SRB_NONE: luw_srb_flags_t = 0;
pub const luw_srb_flags_t_LUW_SRB_APPEND: luw_srb_flags_t = 1;
pub const luw_srb_flags_t_LUW_SRB_ALLOC: luw_srb_flags_t = 2;
pub const luw_srb_flags_t_LUW_SRB_FULL_SIZE: luw_srb_flags_t = 4;
pub const luw_srb_flags_t_LUW_SRB_FLAGS_ALL: luw_srb_flags_t = 7;
But then this requires some further changes to make the names nicer
without the type prefixed.
This will only be exasperated when adding an enum containing the HTTP
status codes...
So instead, tell bindgen to use the 'rustified_enum' method which
produces this
pub enum luw_srb_flags_t {
LUW_SRB_NONE = 0,
LUW_SRB_APPEND = 1,
LUW_SRB_ALLOC = 2,
LUW_SRB_FULL_SIZE = 4,
LUW_SRB_FLAGS_ALL = 7,
}
which in theory requires no extra changes (it doesn't with the http
status codes enum), however in this specific case, because these are
actually bitflags we still need to cast them to u32 so they can be OR'd.
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
0 commit comments