
14 Oct
2013
14 Oct
'13
6:15 a.m.
On 2013-10-14 at 06:07:01 +0200, Bryan O'Sullivan wrote: [...]
You'll want to take a look at what hsc2hs actually does here to really understand :-)
In short, a constant C-level expression is fine if used in a #const construct, regardless of it containing embedded casts and whatnot.
thx, now I see! :-) Otoh, does that mean one could have rewritten that to something like ##if defined(RLIM_SAVED_MAX) && (#{const RLIM_SAVED_MAX} != #{const RLIM_INFINITY}) unpackRLimit (#const RLIM_SAVED_MAX) = ResourceLimitUnknown ##endif instead and exploit the fact that CPP can be run a second time when compiling the resulting .hs file, which would then take care of the #ifdef with the '#const' terms already evaluated? Cheers, hvr