Skip to content

Need a way to specify codegen behavior for enum items #392

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

Closed
upsuper opened this issue Jan 10, 2017 · 1 comment
Closed

Need a way to specify codegen behavior for enum items #392

upsuper opened this issue Jan 10, 2017 · 1 comment

Comments

@upsuper
Copy link
Contributor

upsuper commented Jan 10, 2017

In nsCSSPropertyID enum, we have something like:

enum nsCSSPropertyID {
  eCSSProperty_a,
  eCSSProperty_b,
  // ...

  eCSSProperty_COUNT,
  eCSSProperty_COUNT_DUMMY2 = eCSSProperty_COUNT - 1,

  eCSSPropertyAlias_aa,
  eCSSPropertyAlias_bb,
  // ...
}

In this case, since eCSSPropertyAlias_aa would be identical to eCSSProperty_COUNT, it would become a separate constant rather than an enum item. This is undesired. Ideally, eCSSProperty_COUNT should become a constant, while eCSSPropertyAlias_aa should be an enum item.

I guess we can add something like

/// <div rustbindgen constant></div>

to bindgen to correct this kind of cases.

@emilio
Copy link
Contributor

emilio commented Jan 11, 2017

Fixed by #393 :)

@emilio emilio closed this as completed Jan 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants