Commit Graph

3317 Commits

Author SHA1 Message Date
月出皎兮 83fcd6d5e2 bindgen升级0.70.1版本
Signed-off-by: 月出皎兮 <xietingwei@h-partners.com>
2025-04-15 20:47:01 +08:00
openharmony_ci 7d7f5244d2 !8 Description:[feature] optimize oss's dependencies and spdx identifier info
Merge pull request !8 from jinguang/master
OpenHarmony-v5.1.0-Release
2025-01-22 03:05:33 +00:00
Jinguang Dong 5e3a65600c Description:[feature] optimize oss's dependencies and spdx identifier info
Bug: https://gitee.com/openharmony/third_party_rust_bindgen/issues/IBJ5KE
Test: It could be normally parse by validate_readme_opensource script

Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
2025-01-21 17:23:09 +08:00
openharmony_ci 941db192cb !7 rust_bindgen适配syn升级至2.0
Merge pull request !7 from Future/master
OpenHarmony-v5.0.3-Release OpenHarmony-v5.0.2-Release OpenHarmony-v5.0.1-Release OpenHarmony-v5.0.0-Release OpenHarmony-v5.0-Beta1
2024-04-08 15:02:28 +00:00
徐未来 f9afaba08a 适配syn升级至2.0
Signed-off-by: 徐未来 <xuweilai2@huawei.com>
2024-04-02 15:05:30 +08:00
openharmony_ci f858735032 !6 OAT 查缺补漏
Merge pull request !6 from fangting/master
OpenHarmony-v4.1.4-Release OpenHarmony-v4.1.3-Release OpenHarmony-v4.1.2-Release OpenHarmony-v4.0.4-Release OpenHarmony-v4.0.3-Release OpenHarmony-v4.0.2-Release OpenHarmony-v4.1-Release OpenHarmony-v4.0-Release OpenHarmony-v4.0.1-Release OpenHarmony-v4.1-Beta1 OpenHarmony-v4.1.1-Release master-v weekly_20240115-v
2023-08-07 03:36:42 +00:00
fangting 4aaf87a1f4 OAT补漏
Signed-off-by: fangting <fangting12@huawei.com>
2023-08-07 10:45:51 +08:00
openharmony_ci 87f5c49d62 !5 Add oh user guide
Merge pull request !5 from fangting/master
OpenHarmony-v4.0-Beta1 OpenHarmony-v4.0-Beta2
2023-05-04 06:17:03 +00:00
fangting f4b5d6f44d add oh user guide
Signed-off-by: fangting <fangting12@huawei.com>
2023-05-04 11:58:04 +08:00
openharmony_ci 1e9a2fc6b3 !4 Add README_zh.md
Merge pull request !4 from fangting/readme_zh
2023-04-25 03:45:14 +00:00
fangting 45280b0b0e Add RAEDME_zh.md
Issue:#I6YAO1

Signed-off-by: fangting <fangting12@huawei.com>
2023-04-25 10:18:36 +08:00
openharmony_ci 5c6ee6230e !2 Add OAT.xml and README.OpenSource
Merge pull request !2 from fangting/master
2023-04-14 08:11:09 +00:00
fangting b18fe4e8d7 Add OAT.xml and README.OpenSource
Signed-off-by: fangting <fangting12@huawei.com>
2023-04-14 14:14:38 +08:00
openharmony_ci ba209815c6 !1 [bindgen]Add GN Build Files and Custom Modifications to Rust Third-party Libraries
Merge pull request !1 from lubinglun/master
2023-04-13 11:34:32 +00:00
lubinglun 1a017c9476 Add GN Build Files and Custom Modifications
Issue:https://gitee.com/openharmony/build/issues/I6UFTP
Signed-off-by: lubinglun <lubinglun@huawei.com>
2023-04-12 17:25:45 +08:00
Justin W Smith bd4c765685 Release 0.64.0 Request (#2399)
Prepare 0.64.0 Release

---------

Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
github.com/rust-lang/rust-bindgen/v0.64.0 github.com/rust-lang/rust-bindgen.git/v0.64.0
2023-02-07 10:36:50 -05: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
Christian Poveda Ruiz 7ddf0aba63 Fix wrong entry in changelog (#2404) 2023-02-06 15:40:30 -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 d16cd43f97 Migrate CLI argument parse to the clap derive API (#2390)
* Migrate CLI argument parsing to the derive API

* Fix docs

* Fix tests

* Use `override_usage`

* Update changelog
2023-01-18 12:38:19 -05:00
Christian Poveda Ruiz 9960524a62 Remove any references to master (#2391) 2023-01-18 12:23:13 -05:00
Amanjeev Sethi 9da0ba2643 Add trigger for push to main branch for sync'ing with master (#2387)
* gh action for merging main to master on pr merge

* remove pull_request as trigger. only use push, that is after merging the pull_request
2023-01-16 11:21:36 -05:00
Andrew Walbran 01dea3b4a4 Update to clap 4. (#2380)
* Update to clap 4.

* Bump MSRV to minimum required by clap 4.

* Mention clap update in CHANGELOG.
2023-01-12 15:37:48 -05:00
Christian Poveda Ruiz 3ffe57ec78 Document semantic difference between constructors and wrappers (#2385) 2023-01-10 17:00:27 -05:00
Amanjeev Sethi 84702adf79 fix: test runner for fuzzy tests and update documentation
Signed-off-by: Amanjeev Sethi <aj@amanjeev.com>
2023-01-08 01:12:53 +01:00
Emilio Cobos Álvarez efc8293c07 codegen: Look through typedefs to detect void return type. (#2379)
* codegen: Look through typedefs to detect void return type.

And reuse a bit more code.

Should fix #2377, but needs a test (can't run tests atm).

* Add tests

* Run rustfmt

* Update changelog

Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
2023-01-06 13:07:28 -05:00
Christian Poveda Ruiz a1943951f4 Run doctoc (#2376) 2022-12-16 12:15:04 -05:00
Christian Poveda Ruiz e7ea8f3f66 Document how to format code (#2375)
* Document how to format code

* Fix typo

* Fix formatting

* Ignore code snippet
2022-12-15 16:16:38 -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 a3a69da6e8 Bump clang-sys version (#2368)
* Bump `clang-sys` version

* add libtinfo5 package to fix CI
2022-12-07 12:27:01 +01:00
Emilio Cobos Álvarez a0af678a04 codegen: Do generate field offset checks for classes with multiple bases.
The bug only affects virtual inheritance, so instead disable layout
tests in the test that we know is broken. Not generating layout tests is
wrong anyways, because the offset would be wrong.
2022-12-07 12:18:35 +01:00
Christian Poveda Ruiz e16d1aff3f Document callback changes and avoid static lifetime (#2366) 2022-11-28 14:01:25 -05:00
Justin W Smith f6b05a4053 Extend generated_name_override callback to variables (#2351)
* This change updates `ParseCallbacks::generated_name_override` to accept a second parameter indicating the kind of item the name applies to (currently, either `Function` or `Var`).
* A `CallbackItemKind` enum was added to serve as the type for this second parameter.
* Tests have been updated to verify that the names of both function and variable can be updated by this callback.
2022-11-28 13:16:10 -05:00
Christian Poveda Ruiz 1f4fe279d6 Update CHANGELOG.md (#2365) 2022-11-28 09:49:51 -05:00
David Tolnay 14df65cb32 Fix name collision between C enum and typedef (#2326)
Fixes #2008.

Example:

```c
enum Enum { Variant };
typedef int16_t Enum;
```

This is valid and idiomatic C (though not valid C++). `cbindgen` uses this idiom as the default C translation of Rust enums, the equivalent of what would be `enum Enum : int16_t { Variant };` in C++.

`bindgen header.h` before:

```rust
pub const Enum_Variant: Enum = 0;
pub type Enum = ::std::os::raw::c_uint;
pub type Enum = i16;
```

```console
error[E0428]: the name `Enum` is defined multiple times
 --> generated.rs:3:1
  |
2 | pub type Enum = ::std::os::raw::c_uint;
  | --------------------------------------- previous definition of the type `Enum` here
3 | pub type Enum = i16;
  | ^^^^^^^^^^^^^^^^^^^^ `Enum` redefined here
  |
  = note: `Enum` must be defined only once in the type namespace of this module
```

After:

```rust

pub const Enum_Variant: Enum = 0;
pub type Enum = i16;
```
2022-11-28 09:40:20 -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 870e9723bc Escape method fragments that happen to be rust keywords (#2359) 2022-11-23 12:48:24 -05:00
Emilio Cobos Álvarez 1d1103ae94 CONTRIBUTING: Add docs for doing a release. (#2358) 2022-11-22 13:27:27 -05:00
Christian Poveda Ruiz 748be2e995 Release v0.63.0 (#2357) 2022-11-22 12:44:10 -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 0cbd492cc5 Introduce DeriveInfo (#2355)
This PR introduces a new non-exhaustive `struct` called `DeriveInfo` to be used as the sole argument of `ParseCallbacks::add_derives` with the purpose of being able to extend the information passed to this method in a backwards-compatible manner, meaning that adding new fields to `DeriveInfo` won't be a breaking change when releasing a new version.
2022-11-21 10:38:42 -05:00
Christian Poveda Ruiz f730d1dc57 Remove deprecated methods (#2346) 2022-11-17 10:02:29 -05:00
Fabio Valentini 0d9e9967f6 add LICENSE symlinks to all individually published crates 2022-11-17 14:35:56 +01:00
Emilio Cobos Álvarez 310daa14bb v0.62.0 2022-11-17 04:36:23 +01:00
Christian Poveda Ruiz 99ad2beef6 document regex arguments handling (#2345) 2022-11-14 12:34:05 -05:00