You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <[email protected]>
Copy file name to clipboardExpand all lines: bindgen-cli/options.rs
+30
Original file line number
Diff line number
Diff line change
@@ -353,6 +353,20 @@ struct BindgenCommand {
353
353
/// Derive custom traits on a `union`. The <CUSTOM> value must be of the shape <REGEX>=<DERIVE> where <DERIVE> is a coma-separated list of derive macros.
354
354
#[arg(long, value_name = "CUSTOM")]
355
355
with_derive_custom_union:Vec<String>,
356
+
/// Generate wrappers for `static` and `static inline` functions.
357
+
#[arg(long, requires = "experimental")]
358
+
wrap_static_fns:bool,
359
+
/// Sets the path for the source file that must be created due to the presence of `static` and
0 commit comments