Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize --wrap-static-fns #2928

Merged
merged 2 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
# Unreleased
## Added
## Changed
- The `--wrap-static-fns` related options no longer require the experimental feature or flag.
## Removed
## Fixed
- Use the right characters for newlines on windows.
Expand Down
6 changes: 3 additions & 3 deletions bindgen-cli/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,15 @@ struct BindgenCommand {
#[arg(long, value_name = "CUSTOM", value_parser = parse_custom_attribute)]
with_attribute_custom_union: Vec<(Vec<String>, String)>,
/// Generate wrappers for `static` and `static inline` functions.
#[arg(long, requires = "experimental")]
#[arg(long)]
wrap_static_fns: bool,
/// Sets the PATH for the source file that must be created due to the presence of `static` and
/// `static inline` functions.
#[arg(long, requires = "experimental", value_name = "PATH")]
#[arg(long, value_name = "PATH")]
wrap_static_fns_path: Option<PathBuf>,
/// Sets the SUFFIX added to the extern wrapper functions generated for `static` and `static
/// inline` functions.
#[arg(long, requires = "experimental", value_name = "SUFFIX")]
#[arg(long, value_name = "SUFFIX")]
wrap_static_fns_suffix: Option<String>,
/// Set the default VISIBILITY of fields, including bitfields and accessor methods for
/// bitfields. This flag is ignored if the `--respect-cxx-access-specs` flag is used.
Expand Down
2 changes: 1 addition & 1 deletion bindgen-tests/tests/headers/wrap-static-fns.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// bindgen-flags: --experimental --wrap-static-fns
// bindgen-flags: --wrap-static-fns
// bindgen-parse-callbacks: wrap-as-variadic-fn

// to avoid polluting the expectation tests we put the stdarg.h behind a conditional
Expand Down
9 changes: 2 additions & 7 deletions bindgen/options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1419,10 +1419,8 @@ options! {
/// Note that they will usually not work. However you can use `-fkeep-inline-functions`
/// or `-fno-inline-functions` if you are responsible of compiling the library to make
/// them callable.
#[cfg_attr(
feature = "experimental",
doc = "\nCheck the [`Builder::wrap_static_fns`] method for an alternative."
)]
///
/// Check the [`Builder::wrap_static_fns`] method for an alternative.
pub fn generate_inline_functions(mut self, doit: bool) -> Self {
self.options.generate_inline_functions = doit;
self
Expand Down Expand Up @@ -2021,7 +2019,6 @@ options! {
/// Whether to generate wrappers for `static` functions.
wrap_static_fns: bool {
methods: {
#[cfg(feature = "experimental")]
/// Set whether to generate wrappers for `static`` functions.
///
/// Passing `true` to this method will generate a C source file with non-`static`
Expand All @@ -2040,7 +2037,6 @@ options! {
/// The suffix to be added to the function wrappers for `static` functions.
wrap_static_fns_suffix: Option<String> {
methods: {
#[cfg(feature = "experimental")]
/// Set the suffix added to the wrappers for `static` functions.
///
/// This option only comes into effect if `true` is passed to the
Expand All @@ -2057,7 +2053,6 @@ options! {
/// The path of the file where the wrappers for `static` functions will be emitted.
wrap_static_fns_path: Option<PathBuf> {
methods: {
#[cfg(feature = "experimental")]
/// Set the path for the source code file that would be created if any wrapper
/// functions must be generated due to the presence of `static` functions.
///
Expand Down