26 Commits

Author SHA1 Message Date
ljy9810 47578c3c78 bitflags升级,配套修改
Signed-off-by: ljy9810 <longjianyin@h-partners.com>
2025-11-13 15:28:56 +08:00
a30054014 b54cf916fe rust-bindgen相关依赖兼容性适配
Signed-off-by: a30054014 <aipeng3@huawei.com>
2025-04-19 16:17:39 +08:00
a30054014 c1e7498e84 rust-bindgen相关依赖兼容性适配
Signed-off-by: a30054014 <aipeng3@huawei.com>
2025-04-19 16:11:11 +08:00
oh_ci 39e4f73eb8 回退 'Pull Request !9 : bindgen升级0.70.1版本' 2025-04-19 06:22:12 +00:00
月出皎兮 83fcd6d5e2 bindgen升级0.70.1版本
Signed-off-by: 月出皎兮 <xietingwei@h-partners.com>
2025-04-15 20:47:01 +08:00
Christian Poveda Ruiz bd14f85019 Generate extern wrappers for inlined functions (#2335)
* Generate extern wrappers for inlined functions

If bindgen finds an inlined function and the
`--generate-extern-functions` options is enabled, then:

- It will generate two new source and header files with external
  functions that wrap the inlined functions.
- Rerun `Bindings::generate` using the new header file to include these
  wrappers in the generated bindings.

The following additional options were added:
- `--extern-function-suffix=<suffix>`: Adds <suffix> to the name of each
  external wrapper function (`__extern` is used by default).
- `--extern-functions-file-name=<name>`: Uses <name> as the file name
  for the header and source files (`extern` is used by default).
- `--extern-function-directory=<dir>`: Creates the source and header
  files inside <dir> (`/tmp/bindgen` is used by default).

The C code serialization is experimental and only supports a very
limited set of C functions.

Fixes #1090.

---------

Co-authored-by: Amanjeev Sethi <aj@amanjeev.com>
2023-02-07 10:13:48 -05:00
Josh Guilfoyle df08ad80cf Add *-espidf target triple mappings (#2397)
Fixes #2396.

This makes it possible to workaround cc/bindgen issues with esp-rs
projects by using only environment varaibles (TARGET_CC, CLANG_PATH,
etc).  Without this, it requires modifying each crate's build.rs that
you try to depend on to add a target option passed along to clang.
2023-01-25 17:54:19 -05:00
Dan Dumont e8f278ed11 Implement cli option for custom derive (#2328)
* custom derives after DeriveInfo

* Introduce `TypeKind` instead of `CompKind`

* Add tests

* Emit CLI flags for callbacks

* update changelog

* run rustfmt

* fix tests

* fix features

Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
2023-01-20 15:12:42 -05:00
Christian Poveda Ruiz d6965c9264 Extend documentation about deprecation of wildcard patterns (#2374) 2022-12-15 16:02:28 -05:00
Christian Poveda Ruiz 3685af64ac Fix clippy warnings (#2371) 2022-12-09 16:15:59 -05:00
Christian Poveda Ruiz b898d1c84f Remove traits that have a single implementation (#2363) 2022-11-24 11:17:08 -05:00
Christian Poveda Ruiz 4b3940e6c8 Fix clippy warnings (#2362) 2022-11-24 10:50:15 -05:00
Christian Poveda Ruiz b7fcf872dd Deprecate Rust targets lower or equal than 1.30 (#2356) 2022-11-22 12:31:14 -05:00
Christian Poveda Ruiz 3b303cc072 Add --wrap-unsafe-ops option (#2354)
This reverts commit fc6c702695 and adds a new `--wrap-unsafe-ops` option as a workaround.
2022-11-22 11:41:32 -05:00
Christian Poveda Ruiz ba546f41c4 Add ParseCallbacks::process_comment (#2347)
This method can be used to process comments and replace them with whatever the user wants.
2022-11-22 11:25:13 -05:00
Christian Poveda Ruiz f730d1dc57 Remove deprecated methods (#2346) 2022-11-17 10:02:29 -05:00
Christian Poveda Ruiz 99ad2beef6 document regex arguments handling (#2345) 2022-11-14 12:34:05 -05:00
Christian Poveda Ruiz e682f5e260 Document and test allowlisting and blocklisting methods (#2344) 2022-11-11 13:01:53 -05:00
Christian Poveda Ruiz 5d59fb14d9 Clean the implementation of Default for BindgenOptions (#2332)
* Clean the implementation of `Default` for `BindgenOptions`
2022-11-04 13:08:14 -05:00
Christian Poveda Ruiz 18ccd45509 Add the --override-abi option (#2329)
* Add the `--override-abi` option.

This option can be used from the CLI with the <abi>:<regex> syntax and
it overrides the ABI of a function if it matches <regex>.

Fixes #2257
2022-11-02 15:30:34 -05:00
Christian Poveda Ruiz 8136142661 Allow callback composition (#2330)
* Allow callback composition

Store all the callbacks added to the builder in a `Vec` so bindgen
invokes each one of them in a last-to-first manner.
2022-11-02 13:46:22 -05:00
Christian Poveda Ruiz 36eb92ba85 Fix clippy warnings (#2331) 2022-11-02 13:32:32 -05:00
Christian Poveda Ruiz 6f71fafe26 Add a mechanism to rerun bindgen with the same user options (#2292)
* Run `Bindings::generate` again if required.

This adds a mechanism so `bindgen` is able to run `Bindings::generate`
multiple times with the same user input if the `generate_static_inline`
option is enabled and `GenerateResult::ShouldRestart` is returned by
`Bindings::generate`.

This is done to eventually solve #1090 which would require to check for
any static inline functions and generate a new header file to be used as
an extra input and run `Bindings::generate` again.
2022-11-01 08:49:57 -05:00
Christian Poveda 49afd96b4f Use panic hooks instead of using catch_unwind
One of the advantages of doing this is that `ParseCallbacks` no longer
needs to implement `UnwindSafe` which means that users can rely on
`RefCell` and `Cell` to extract information from the callbacks.

Users relying on `catch_unwind` can still achieve similar behavior using
`std::thread::spawn`.

Fixes #2147.
2022-10-22 13:11:45 +02:00
Christian Poveda 5d93b0145b Implement Clone for Builder
This is done by moving all the remaining `Builder` state into
`BindgenOptions` so any internal logic that affects `Builder` state only
runs once the builder is consumed by `Builder::generate`:

- move `input_headers` to `BindgenOptions`.
- move `input_header_contents` to `BindgenOptions`.
- derive `Clone` for `Builder`.
2022-10-07 14:10:24 -05:00
Christian Poveda 1213b3dfb1 split the repo into a workspace
remove `clap` dependency 🎉

update the book installation instructions
2022-10-04 20:47:17 -05:00