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

Limited support for const qualifier #73

Open
jonas opened this issue Jun 25, 2018 · 0 comments
Open

Limited support for const qualifier #73

jonas opened this issue Jun 25, 2018 · 0 comments
Labels
bindgen Binding generator rfc A proposal for a new functionality

Comments

@jonas
Copy link
Member

jonas commented Jun 25, 2018

Right now const is discarded, however, it should be possible to support its use in certain places, namely:

extern const int PI;
struct point { int x; int y; };
const struct point *get_cursor(void);
typedef bool (*visitor)(const struct point *point);

For variables (#70), the Scala definition should use val and for structs, one idea is to generate a separate type alias for const structs with an ops implicit class that does not contain the field_= methods. It would be nice to come up with an encoding that allows non-const structs to be assigned to a const version and disallow the inverse.

@jonas jonas added rfc A proposal for a new functionality bindgen Binding generator labels Jun 25, 2018
@jonas jonas changed the title RFC: Limited support for const qualifier Limited support for const qualifier Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bindgen Binding generator rfc A proposal for a new functionality
Projects
None yet
Development

No branches or pull requests

1 participant