Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `generated_link_name_override` method for `ParseCallbacks`. `generated_link_name_override` lets the developer choose the link name for a symbol. If a link name is specified, the attribute `#[link_name = "\u{1}VALUE"]` will be set, overriding any other potential link name, including the mangled name. This commit also adds an option to the bindgen cli called `prefix-link-name`, to prefix the link name of exported symbols. I think this should properly solve #1375. * Fix expectation file for `prefix-link-name-c`. * Fix expectation file for `prefix-link-name-cpp` * Add a new `parse_callbacks` callback to solve the roundtrip test.
- Loading branch information
Showing
10 changed files
with
166 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
bindgen-tests/tests/expectations/tests/prefix-link-name-c.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
bindgen-tests/tests/expectations/tests/prefix-link-name-cpp.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// bindgen-parse-callbacks: prefix-link-name-foo_ | ||
// bindgen-flags: --prefix-link-name foo_ | ||
|
||
int bar(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// bindgen-parse-callbacks: prefix-link-name-foo_ | ||
// bindgen-flags: --prefix-link-name foo_ | ||
|
||
namespace baz { | ||
|
||
int foo(); | ||
|
||
} // end namespace baz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters