summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-01-22Add comments about regex usage in {white|black}list functionsAurora
2020-01-13codegen: Max guaranteed alignment is 8 (with u64), not target pointer width.Emilio Cobos Álvarez
2020-01-13Remove padding for over-aligned structs when we support repr(align).Emilio Cobos Álvarez
Before repr(align), we could only safely guarantee up to 8-bytes of alignment (I think the pointer-width check is a more conservative way of doing that, in practice, because I _think_ u64 is 8-byte aligned even for smaller targets). So when we may generate a potentially-under-aligned struct, we always used to pad it so as to guarantee that at least the size (and thus reads from rust for C-allocated structs) was fine. But if we support repr(align), then the above is always unneeded.
2020-01-05Added non-keyword support to objective-c methods.Sebastian Imlay
2020-01-05An initial implementation of objective-c generics for #1259 (#1702)simlay
2019-12-20Update latest stable rust to 1.40 and give non_exhaustive featureJohn Brandt
2019-12-16Remove deprecated Error::descriptionKornel
2019-12-13Remove size_t to usize conversion ruleConor McAvity
2019-12-11codegen: Minor cleanup after #1691.Emilio Cobos Álvarez
2019-12-11Add support for wasm_import_moduleJasper-Bekkers
2019-11-28Fix warning on rustdocJake Merdich
Rustdoc was treating doc comments containing `#[non_exhaustive]` as links and warning, so mark that as code to avoid the warning.
2019-11-25Move warnings check on the CILuca Barbato
Always building with `deny(warnings)` leads to messups such as https://docs.rs/crate/bindgen/0.52.0/builds/199624
2019-11-14Make rustfmt happyDavid Vo
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-14Warn rather than panic on unknown namespace prefixJon Gjengset
When a #defined token was used before a namespace, like so (#1676): #define nssv_inline_ns inline nssv_inline_ns namespace literals {} bindgen would crash when encountering the unknown token preceding the namespace token. This is because we don't get to see "past" the ifdef to the underlying token. The true fix to this is to find a way to extract ifdef info through clang, but for the time being we simply change the panic into a warning when such a token is encountered, and then proceed as if it were empty. Fixes #1676.
2019-11-09Replace unsafe ref->ptr transmute with 'as' castingElichai Turkel
2019-11-08Option to use #[repr(transparent)] structs instead of type aliasing.Joseph Rafael Ferrer
2019-11-08Add support for MaybeUninitElichai Turkel
2019-11-03Do not generate implementation for clone for FAMDavid Frey
Flexible array members are represented in the generated binding by a struct __IncompleteArrayField<T>. Since such members do not contain any information about how big they are, it is impossible to automatically clone or copy them, either in C or rust. Fixes #1431.
2019-10-28Move rust feature docs into a more useful place.Emilio Cobos Álvarez
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-22codegen: Handle opaque aliases to enums correctly.Emilio Cobos Álvarez
Opaque types don't use the path to their aliased type but an opaque type like an array or primitive with the right alignment. Fixes #1599.
2019-10-21Cargo fmt.Emilio Cobos Álvarez
2019-10-21Allow static and dynamic linkingJeremy Fitzhardinge
Currently bindgen always uses clang-sys with the "runtime" feature - that is, load libclang at runtime with dlopen (or similar) at runtime. This PR keeps this default, but also - adds "static" to statically link libclang - without either "runtime" or "static", link with the shared library Many distributions don't ship with a static libclang, but linking with the dynamic library will use normal ld.so mechanisms to define where the .so file should be found. (Ditto for the Mac and Windows equivalents.)
2019-10-14Rustfmt to account for rebase.Emilio Cobos Álvarez
2019-10-14Run `cargo fmt` on the main crate.Emilio Cobos Álvarez
2019-10-14Add llvm 9.0 to CI.Emilio Cobos Álvarez
2019-10-14function: Fix #[must_use] support in libclang 9+.Emilio Cobos Álvarez
2019-10-14features: core::ffi::c_void isn't really available before 1.30.Emilio Cobos Álvarez
2019-10-08Fix BitfieldUnit constructor to handle 64 bit wide bitfields on 32 bit.Cameron McCormack
Fixes #1639.
2019-10-08Rename Item::canonical_name_cache for consistency.Cameron McCormack
2019-10-08Use a LazyCell for Item::canonical_name_cache and Item::local_id.Cameron McCormack
It's slightly neater.
2019-10-08Cache the result of Item::path_for_whitelisting.Cameron McCormack
2019-10-08Add ParseCallbacks handler for included fileschrysn
As the clang_File_tryGetRealPathName function is only exposed by clang_sys for clang >= 7.0, this raises the clang dependency. Closes: https://github.com/rust-lang/rust-bindgen/issues/1635 The book example code for creating a builder to run inside Cargo is extended by using the rereun-if-changed headers.
2019-10-08Don't always output translation_unit timer.Cameron McCormack
2019-10-04Build the rustified_non_exhaustive_enums RegexSet.Cameron McCormack
2019-10-04Add a couple more timers.Cameron McCormack
For the remaining named parts of Context::gen.
2019-10-03Use c_void from core when --use-core is specifiedKyle Tomsic
`c_void` is available as `::std::os::raw::c_void` and `::core::ffi::c_void`. If the "--use-core" option is specified (but no --ctypes-prefix is provided), we should emit `::core::ffi::c_void` rather than the `std` one.
2019-09-28Fallback: call "rustfmt" directly without whichheidezomp
If the `which-rustfmt` feature isn't enabled, assume that the binary is called "rustfmt" and that it is in the user's PATH, instead of returning an error.
2019-09-23ir: Make Ord and PartialOrd implementations agree.Emilio Cobos Álvarez
See https://github.com/rust-lang/rust/issues/64710. Bogus implementations were introduced in 230545e7c, d3e39dc62, and 379bb1663.
2019-09-23fxhash -> rustc-hashEvgeniy A. Dushistov
fixes #1616
2019-09-17Improve the script to enforce rustfmt on automation.Emilio Cobos Álvarez
2019-09-17Rustfmt.Emilio Cobos Álvarez
2019-09-17Return Error if no rustfmt path given and which-rustfmt feature is disabledRyan Lopopolo
2019-09-17Do not use which if which-rustfmt feature is disabledRyan Lopopolo
This commit changes the API of rustfmt_path to return Result<Option<Cow<PathBuf>>>. Ok(None) is returned in the case where which is disabled and no rustfmt command is supplied explicitly either via configuration or env variable. Downstream code checks for the presence of None to directly return the source without emitting an error.
2019-09-02Update syn related dependencies and bump versionBastien Orivel
2019-07-27Fix beta build warnings / errors. (#1603)Emilio Cobos Álvarez
Fixes #1598
2019-07-26Allow to override rustfmt path with an environment variable.Emilio Cobos Álvarez
Fixes #1601
2019-07-24Cleanup wchar_t layout computation to happen later. (#1596)Emilio Cobos Álvarez
This is a breaking cheange since WChar is exposed, but should be no behavior change otherwise.
2019-07-23Don't emit #[repr(align(0))] for empty unions (#1595)Patrick Marks