Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Given that C keeps a different namespace for `struct`s and aliases. The following pattern ```c typedef const struct foo { void *bar; } *foo; ``` is valid C code and produces both a `struct` and a pointer called `foo`. Given that Rust does not make this distinction, we add the `_ptr` prefix to the pointer type alias to avoid any name collisions.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
bindgen-tests/tests/expectations/tests/const_struct_ptr.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,6 @@ | ||
typedef const struct foo { | ||
char bar; | ||
} *foo; | ||
|
||
void takes_ptr(foo); | ||
void takes_struct(struct foo); |
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