[commit: packages/unix] master: Fix assumption that RLIM_INFINITY is a simple number (b092e35)
Bryan O'Sullivan
bos at serpentine.com
Mon Oct 14 04:07:01 UTC 2013
On Sun, Oct 13, 2013 at 12:20 AM, Herbert Valerio Riedel <hvr at gnu.org>wrote:
> > unpackRLimit :: CRLim -> ResourceLimit
> > unpackRLimit (#const RLIM_INFINITY) = ResourceLimitInfinity
>
> [...]
>
> I wonder though, how could that even have compiled in the past on OSX if
> the expanded RLIM_INFINITY macro #define in the LHS pattern wouldn't
> result in a simple number?
>
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131013/82a1a9f6/attachment.html>
More information about the ghc-devs
mailing list