c2hs - anonymous enums?

214 Views Asked by At

The c2hs reference (aka 'Tutorial') mentions the name of the C enum as a non-optional parameter. Is there any way to get it to work with anonymous enums? Determining which enum to generate should be possible given just a single enum member, or even if that's not possible it should at least be possible to generate an enum by explicitly naming it's members.

To clarify:

given an enum

enum {
A,
B,
C,
D
};

I'd like something along the lines of

{#enum {A,B,C,D} as MyEnum #}
1

There are 1 best solutions below

0
On

enum define works (contrary to the documentation)

{# enum define MyEnum { A as A, B as B, C as C, D as D } #}