[Haskell-cafe] ifdef based on which OS you're on

Dan Cross crossd at gmail.com
Mon Feb 25 06:28:15 CET 2013


On Sun, Feb 24, 2013 at 5:28 PM, Andrew Cowie <
andrew at operationaldynamics.com> wrote:

> On Sat, 2013-02-16 at 08:18 +0100, Henk-Jan van Tuyl wrote:
> > > Anyone have any idea if the Cabal library exposes this
> > > somewhere?
> >
> > See...
>
> I blogged about my solution using Krzysztof and Henk's suggestions here:
>
> http://blogs.operationaldynamics.com/andrew/software/haskell/config-dot-h-and-ifdef
>
> Cheers everyone,


I read your blog post and I'm afraid I don't see the point: you write some
code to tap into a pre-existing library that figures out what platform you
are on so that you can write out a 'config.h' that #define's the platform
you are on so that you can then use the C preprocessor to pick a particular
code path via conditional compilation.  Why go to all that bother?  Why not
just write code that writes out the path you want to take and link against
it?

        - Dan C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130225/f1169bb6/attachment.htm>


More information about the Haskell-Cafe mailing list