summaryrefslogtreecommitdiff
path: root/src/options.rs
AgeCommit message (Collapse)Author
2021-11-26Add --blocklist-file option (#2097)David Drysdale
Update Item to hold a `clang::SourceLocation` and use this to allow blocklisting based on filename. The existing code has a special case that always maps <stdint.h> integer types to corresponding Rust integer types, even if the C types are blocklisted. To match this special case behaviour, also treat these C <stdint.h> types as being eligible for derived Copy/Clone/Debug traits. Fixes #2096
2021-10-27Fix warningsMikuroXina
2021-07-31Also implement must-use-type for enums.Karel Peeters
2021-07-31Implement must_use_type commandline flag and builder option.Karel Peeters
2021-07-16Allow explicit padding (#2060)Eric Seppanen
If a struct needs to be serialized in its native format (padding bytes and all), for example writing it to a file or sending it on the network, then explicit padding fields are necessary, as anything reading the padding bytes of a struct may lead to Undefined Behavior.
2021-04-30Add a C naming option (#2045)Boris-Chengbiao Zhou
Closes #2045. Fixes #1252.
2021-04-24Support emitting Makefile-syntax depfiles like gcc/clang/rustc.Adam Perry
Needed to auto-bindgen with a ninja build without the build graph going stale.
2021-04-03Add a flag to ensure all symbols are resolved when a library is loadedDr. Chat
2021-03-14Add option to translate enum integer types to native Rust integer typesJethro Beekman
Fixes #430
2021-03-11Revert "Add flag to ignore type blocklist when computing derive information"Emilio Cobos Álvarez
This reverts commit 7286c815f80b14c0ee77773387434da40f511b42, because it was not intended to be merged after all, see https://github.com/rust-lang/rust-bindgen/pull/2003#issuecomment-796160427.
2021-03-11Add flag to ignore type blocklist when computing derive informationJethro Beekman
Fixes #1454
2021-02-18Rename whitelist -> allowlist and blacklist -> blocklistMarcel Hlopko
For the commandline arguments I added undocumented aliases to old flags, to stay backwards compatible.
2021-01-29Generate fields as non-pub if they would be access restricted in C++.Weston Carvalho
2020-12-19Add option to fit macro consts into smaller typesAntoni Simka
Add a `--fit-macro-constant-types` option to make bindgen try to fit macro integer constants into types smaller than u32/i32. Useful especially when dealing with 8/16-bit architectures. Closes #1945
2020-12-02cli: Expose module_raw_lines to the CLI.Emilio Cobos Álvarez
This makes command_line_args properly return them, instead of dropping them on the floor.
2020-11-26Add --no-default <regex> flagVarphone Wong
Sometimes, we need customize the implement of `Default` for certain types, In these cases, the `nodefault` annotation can be used to prevent bindgen to autoderive the `Default` traits for a type.
2020-11-25Add dynamic loading supportJoe Ellis
Closes #1541. Closes #1846. Co-authored-by: Michael-F-Bryan <michaelfbryan@gmail.com>
2020-08-09Add --default-macro-constant-typeChih-Hung Hsieh
* --default-macro-constant-type could be 'signed' or 'unsigned' * Its default value is 'unsigned' to use u32/u64 for C macro constants that fit into the u32/u64 ranges. * For old C libraries that use macros as int/long parameter and/or return value types, their macros are better declared as i32/i64 if the values fit the i32/i64 ranges, to be compatible with c_int/c_long types. They can use "--default-macro-constant-type signed"
2020-08-04Move `__bindgen_anon_` to constant `DEFAULT_ANON_FIELDS_PREFIX`Varphone Wong
2020-08-04Make anon-fields-prefix non-optionalDarren Kulp
2020-08-04Add --anon-fields-prefix optionVarphone Wong
Allow to use the given prefix for the anon fields instead of `__bindgen_anon_`.
2020-08-03Add --no-debug <regex> flagVarphone Wong
2020-06-29Add option to disable generated header commentDarren Kulp
2020-05-18add command-line option for disabling untagged unionsNathan Froyd
One more thing that we can configure from the command line.
2020-02-03options: Add an opt-in to recover the size_t behavior removed in 5d38f2ac.Emilio Cobos Álvarez
2019-12-11Add support for wasm_import_moduleJasper-Bekkers
2019-11-14Add newtype enum styleDavid Vo
This adds an enum style similar to the existing bitfield style, without the bitwise operator impls. Closes: #1669
2019-11-08Option to use #[repr(transparent)] structs instead of type aliasing.Joseph Rafael Ferrer
2019-10-22Add `disable_nested_struct_naming` option (#1610)oblique
The following structs have different names for C and C++. In case of C they are visible as `foo` and `bar`. In case of C++ they are visible as `foo` and `foo::bar`. By default bindgen follows C++ naming to avoid generating duplicate names. With this option the following structs will be named as `foo` and `bar` instead of `foo` and `foo_bar`. ``` struct foo { struct bar { } b; }; ``` In case of an unnamed definition we build the canonical name from the inner most named definition. For example the following will generate `baz__bindgen_ty_1`: ``` struct foo { struct bar { struct baz { struct { } u; } z; } b; }; ``` This option should be used only for C headers. It is needed in some rare situations where user used another code generator that already mangled nested definitions. A real life example is [asn1c] with `-fcompound-names` option. [asn1c]: https://github.com/vlm/asn1c
2019-10-14Run `cargo fmt` on the main crate.Emilio Cobos Álvarez
2019-09-17Rustfmt.Emilio Cobos Álvarez
2019-07-27Fix beta build warnings / errors. (#1603)Emilio Cobos Álvarez
Fixes #1598
2019-06-10Add support for non_exhaustive rustified enums.uk
Implements the feature discussed in https://github.com/rust-lang/rust-bindgen/issues/1554.
2019-05-22Added array pointers to the CLIElichai Turkel
2019-05-21Update LinksAlex Touchet
2019-03-26options: Add an option to opt-out of include path detection.Emilio Cobos Álvarez
And don't do it conditionally on the presence of --target. We pass the clang arguments to clang-sys now, so it doesn't get the wrong path.
2018-12-23Allow to turn off the matches recording introduced in #1469.Emilio Cobos Álvarez
2018-12-14ir: Put function attribute detection under an opt-in flag.Emilio Cobos Álvarez
Given it was a considerable performance hit under some workloads. Closes #1465.
2018-10-13Changed 'identifier' to 'item', added c++ testJason Reed
2018-10-12Re-add ability to blacklist arbitrary identifiersJason Reed
(regardless of which sort of Item they are)
2018-10-04Puts blocks behind a switch.Emilio Cobos Álvarez
Since #1378 broke a bunch of OSX builds. Most people don't care about them and they're in some OSX system headers which means that this could break normal C and C++ stuff. This introduces --generate-block / generate_block to generate these signatures, and adds tests so that this is getting tested.
2018-09-10generate type alias for the `block` typeFlier Lu
2018-08-29options: mark clang-args lastSymphorien Gibol
before, bindgen -- -I blah would try to open `-I` as a header file.
2018-08-14Convert CodegenOptions to a bitfield.Sébastien Duquette
2018-08-13Add ability to blacklist functions.Emilio Cobos Álvarez
Fixes #1336
2018-06-04add --constified-enum to output consts when the default is changedDaniel Brooks
2018-06-04Rename from "enum variant" to "enum style"Daniel Brooks
2018-06-03Add an option to set the default codegen style for all enumsDaniel Brooks
2018-03-31options: Remove the linking-related options.Emilio Cobos Álvarez
They do nothing, and are effectively superseded by --raw-line and friends. They also tend to confuse people. Closes #104
2018-03-04Untry.Emilio Cobos Álvarez
Use the ? operator instead of try, and add some more uses of it on Option<> that were straight-forward.