c2hs
c2hs copied to clipboard
Workaround for GenBind.evalCCast error
I get the following message when using enum define
:
c2hs.exe: Feature not yet implemented:
GenBind.evalCCast: Casts are implemented only for integral constants
The macros involved are #define
ed in terms of other helper macros like:
#define WRAPPER(x) ((int)((x) & 15) << 16)
#define MACRO_ORIGIN 42
#define MACRO_TEST WRAPPER(MACRO_ORIGIN)
Then, when I refer to MACRO_TEST
in my .chs
file like this, c2hs
will fail:
{#enum define Flags { MACRO_TEST as Test } deriving (Eq, Show) #}
The header file is a system header, so I cannot just modify the definition. Is there any workaround for this, or should I just rewrite enum define
by hand?