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

Request: sort all items emitted based on their item type #1743

Closed
Lokathor opened this issue Mar 8, 2020 · 1 comment · Fixed by #2254
Closed

Request: sort all items emitted based on their item type #1743

Lokathor opened this issue Mar 8, 2020 · 1 comment · Fixed by #2254

Comments

@Lokathor
Copy link
Contributor

Lokathor commented Mar 8, 2020

When generating bindings for say SDL2 you get output portions like this:

pub const SDL_INIT_EVERYTHING: u32 = 62001;
extern "C" {
  pub fn SDL_GetPlatform() -> *const chlorine::c_char;
}
pub type size_t = chlorine::c_ulonglong;
pub type wchar_t = chlorine::c_ushort;
pub type va_list = __builtin_va_list;
pub const SDL_FALSE: SDL_bool = 0;
pub const SDL_TRUE: SDL_bool = 1;
pub type SDL_bool = i32;

It would be nice if all items could be sorted so that (for example) all types are declared first, then all structs, then all consts, then all function signatures, etc.

@emilio
Copy link
Contributor

emilio commented Mar 11, 2020

I think that'd be reasonable... I think our current ordering is the order in which we parse the C / C++

amanjeev added a commit to ferrous-systems/rust-bindgen that referenced this issue Aug 11, 2022
Generated code needs some sorting in a way that is
semantically appealing. The request[1] asks for basic
sorting like "ypes are declared first, then all structs,
then all consts, then all function signatures, etc.

[1] rust-lang#1743
amanjeev added a commit to ferrous-systems/rust-bindgen that referenced this issue Aug 11, 2022
Generated code needs some sorting in a way that is
semantically appealing. The request[1] asks for basic
sorting like "ypes are declared first, then all structs,
then all consts, then all function signatures, etc.

[1] rust-lang#1743
emilio pushed a commit that referenced this issue Aug 24, 2022
Generated code needs some sorting in a way that is
semantically appealing. The request[1] asks for basic
sorting like "types are declared first, then all structs,
then all consts, then all function signatures, etc.

[1] #1743

Signed-off-by: Amanjeev Sethi <aj@amanjeev.com>
Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
Co-authored-by: Darren Kulp <darren@kulp.ch>
aatifsyed pushed a commit to aatifsyed/rust-bindgen that referenced this issue Sep 22, 2022
Generated code needs some sorting in a way that is
semantically appealing. The request[1] asks for basic
sorting like "types are declared first, then all structs,
then all consts, then all function signatures, etc.

[1] rust-lang#1743

Signed-off-by: Amanjeev Sethi <aj@amanjeev.com>
Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
Co-authored-by: Darren Kulp <darren@kulp.ch>
qsdrqs pushed a commit to qsdrqs/rust-bindgen that referenced this issue Oct 26, 2022
Generated code needs some sorting in a way that is
semantically appealing. The request[1] asks for basic
sorting like "types are declared first, then all structs,
then all consts, then all function signatures, etc.

[1] rust-lang#1743

Signed-off-by: Amanjeev Sethi <aj@amanjeev.com>
Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
Co-authored-by: Darren Kulp <darren@kulp.ch>
LoganBarnett pushed a commit to LoganBarnett/rust-bindgen that referenced this issue Dec 2, 2023
Generated code needs some sorting in a way that is
semantically appealing. The request[1] asks for basic
sorting like "types are declared first, then all structs,
then all consts, then all function signatures, etc.

[1] rust-lang#1743

Signed-off-by: Amanjeev Sethi <aj@amanjeev.com>
Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
Co-authored-by: Darren Kulp <darren@kulp.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants