Age | Commit message (Collapse) | Author |
|
|
|
Feature was originally introduced in pull-request #1537
|
|
One more thing that we can configure from the command line.
|
|
It seems libclang sometimes doesn't expose the right paramdecl cursors.
This should be reported upstream, but it's easy enough to workaround. It
loses the parameter names which is a bit unfortunate but...
Fixes #1778
|
|
|
|
We should not emit Rust struct methods corresponding to a C++ method
unless we are actually emitting a binding for that method.
|
|
|
|
|
|
|
|
|
|
I believe this should fix #1265.
|
|
That was what I was searching for initially, make life of future me
(and others, hopefully) easier.
|
|
|
|
|
|
|
|
|
|
This allows avoiding large numbers of system calls to dynaload clang
to determine its version, when no action is performed, for example:
- When calling --version / -V
- When calling --help
This improves the raw responsivity from:
Before:
time bindgen --help # 0.593s
strace -cf bindgen --help # 83k syscalls, 64k to statx
After:
time bindgen --help # 0.004s
strace -cf bindgen --help # 90 syscalls
However, it does mean that you can no longer obtain the discovered
clang version with:
RUST_LOG=info bindgen -V
But this may be remedied in a future commit.
Closes: https://github.com/rust-lang/rust-bindgen/issues/1736
|
|
I spent an afternoon scratching my head on this one before I ran
into https://github.com/rust-lang/rust-bindgen/issues/1728.
Since the error message welcomes PRs...
|
|
|
|
Fixes #1727
|
|
|
|
By not generating various code for it.
In the future, we could improve on this by splitting contiguous bitfield units,
if needed, so that we can implement them without dealing with rust array derive
limits.
Fixes #1718
|
|
|
|
Fixes #1716
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rustdoc was treating doc comments containing `#[non_exhaustive]`
as links and warning, so mark that as code to avoid the warning.
|
|
Always building with `deny(warnings)` leads to messups such as
https://docs.rs/crate/bindgen/0.52.0/builds/199624
|
|
|
|
This adds an enum style similar to the existing bitfield style, without
the bitwise operator impls.
Closes: #1669
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
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
|
|
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.
|
|
|
|
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.)
|
|
|
|
|