-
Notifications
You must be signed in to change notification settings - Fork 37
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
Don't name anonymous enums #29
Comments
Do you have an example of C code causing this problem? |
Try any anonymous enum with multiple elements. For example, the following is taken from a header I was translating:
It got translated to this:
Nobody's going to want to write |
I'll see what I can do about it. |
There is some problem with translating a corner case. Consider following code:
D doesn't allow such a construction, so the enum is required to have explicit name, on the other side the enum items are still visible in global space. The best thing I can think of at the moment is to declare |
The best solution would be to name the enum and still export its items to the global scope. |
Yeah, just through an alias. |
Could you provide an example ? |
Do you mean to repeat all the enumeration items as the aliases in global scope? |
enum _Anonymous_0
{
FOO,
BAR
}
alias FOO = _Anonymous_0.FOO;
alias BAR = _Anonymous_0.BAR; |
Well, this can be done. |
Fix comments containing format specifiers.
Fix comments containing format specifiers.
D allows them, so I had to search-and-replace to get the Anonymous_x names out.
The text was updated successfully, but these errors were encountered: