NixOS / nix

Nix, the purely functional package manager

Home Page:https://nixos.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C API: Use `enum` instead of `#define` for better codegen

roberth opened this issue · comments

Is your feature request related to a problem? Please describe.

Currently Rust bindgen generates u32 for #define NIX_OK, but nix_err is an int. This then requires an undue cast.

Other code generators will also have trouble associating a type with these, but a C enum could solve the problem.

Describe the solution you'd like

enum nix_err

Describe alternatives you've considered

Maybe some code generators don't know how to deal with enum's. I would consider such a code generator to be very unfinished.

Additional context

Priorities

Add 👍 to issues you find important.