hsc2hs and #include

Ian Lynagh igloo at earth.li
Sat Jul 30 23:25:40 CEST 2011

On Sat, Jul 30, 2011 at 09:10:21PM +0000, Evan Laforge wrote:
> On Sat, Jul 30, 2011 at 8:32 PM, Edward Z. Yang <ezyang at mit.edu> wrote:
> > This is supposed to get defined as a command line argument to the preprocessor,
> > see compiler/main/DriverPipeline.hs.  Are you saying you don't see it when you
> > run hsc2hs? Maybe someone else is calling a preprocessor but missing some of
> > these arguments...
> Yes, I don't see it when I run hsc2hs.  I don't see how a define from
> ghc is going to make it into the hsc2hs generated C file, since it
> just compiles the c file with no special flags.

I think the right thing to do would be to have all the
    #if __GLASGOW_HASKELL__ ...
lines be printf'd by the C program, so they end up in the generated
Haskell file.

But I also think we may as well just remove most of these conditionals.
The GHC < 4.09 tests can surely be removed, and likewise the GHC < 6.3
tests. Personally I'd remove the GHC < 6.10 test too, but perhaps that
will be more contentious.

Any opinions?


More information about the Glasgow-haskell-users mailing list