Commit a389e14
committed
Optionally, keep radix for integer literals in generated bindings
The radices of integer literals in input C and C++ code are retained in the
generated bindings, provided that the newly added builder option is set to true,
or the corresponding CLI flag is used.
If an input header contains constants that have binary, octal, or hexadecimal
representation, the literals in the Rust bindings are output with the same
number base. E.g., 0x10 in C/C++ header would be output as 0x10 in Rust code.
The functionality is accessed with the builder option `keep_integer_radices`,
which defaults to `false` for now. `--keep-integer-radices` is the corresponding
CLI flag.
The existing tests with header files and corresponding expectations that were
affected by this change have been adjusted to accommodate the change: The CLI
flag for keeping the integer radices was added to the bindgen command for those
tests, and the values in the expectations were updated to have the original
radix; the new values were confirmed by hand to equal the original ones.1 parent 5f7aa4b commit a389e14
File tree
35 files changed
+745
-99
lines changed- bindgen-tests/tests
- expectations/tests
- headers
- bindgen
- codegen
- ir
- options
35 files changed
+745
-99
lines changedLines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments