haskell / c2hs

c2hs is a pre-processor for Haskell FFI bindings to C libraries
http://hackage.haskell.org/package/c2hs
Other
198 stars 50 forks source link

Enum omit breaks mapping #161

Open W4RH4WK opened 8 years ago

W4RH4WK commented 8 years ago

Say I have an enum definied in C like this

enum MyEnum {
    SomeA,
    SomeB,
    SomeC
};

Using {# enum MyEnum {} omit (SomeB) #} will result in

data MyEnum = SomeA
            | SomeC
  deriving (Enum)

Of course now the mapping is messed up since SomeB from C will map to SomeC in Haskell.

Edit: Using version 0.27.1 (29 Nov 2015)