summaryrefslogtreecommitdiffhomepage
path: root/CODE_OF_CONDUCT.md
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-09-05 20:24:29 +0100
committerAndrew Clayton <a.clayton@nginx.com>2023-09-05 20:35:44 +0100
commit76f8f41487e361c00099a729dee2e293a4b713a5 (patch)
tree5adc4aa9747b304585e5466759e8ec497da94454 /CODE_OF_CONDUCT.md
parent6764e6e8ac3f1223536c35d7daef0755df144643 (diff)
downloadunit-wasm-76f8f41487e361c00099a729dee2e293a4b713a5.tar.gz
unit-wasm-76f8f41487e361c00099a729dee2e293a4b713a5.tar.bz2
rust: Change how bindgen creates enums
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>
Diffstat (limited to 'CODE_OF_CONDUCT.md')
0 files changed, 0 insertions, 0 deletions