diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-02-27 10:04:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-27 10:04:41 -0800 |
commit | 4e4f092d603828647bae12754a57c59efdfee005 (patch) | |
tree | 7cb8b83b893e36b145a7e28e88b4a7f71e4f76b5 /src/codegen/struct_layout.rs | |
parent | b666c733057e77ccb670734b56bcdc8bb1be4ce4 (diff) | |
parent | 49fa29935d9f2848b00a4936bee757b3e11df0af (diff) |
Auto merge of #543 - th0rex:master, r=emilio
Add option to not add enum name to bitfield or constant variants
Many C libraries prefix the variants of their enums already, because C enums are not scoped. That means if bindgen prefixes them again that can lead to ugly names like `cs_arch_CS_ARCH_ARM`. The `cs_arch_` part comes from the name of the enum itself and `CS_ARCH_ARM` is the name of the actual variant.
This pull request introduces a variable for changing this behaviour, alongside command line flags and a test case. If `prepend_enum_names` is set to false the resulting variant name will be `CS_ARCH_ARM` instead of `cs_arch_CS_ARCH_ARM` as it is now.
If there is anything that could be improved, or this toggle already exists (I have not found anything like that), please let me know.
Diffstat (limited to 'src/codegen/struct_layout.rs')
0 files changed, 0 insertions, 0 deletions