Do ghc and ghci handle CPP differently?  In ghci, I'm getting "phase `C
pre-processor' failed (exitcode = 1)" when I #include the same .h file more
than once in a module.  I also get warnings about a symbol being redefined,
although I'm careful to #undef them it the end of the include file.  All
works fine with ghc.

Here's my code:

    #define APPLICATIVE Vec1
    #include "ApplicativeNumeric-inc.hs"

    #define APPLICATIVE Vec2
    #include "ApplicativeNumeric-inc.hs"

    #define APPLICATIVE Vec3
    #include "ApplicativeNumeric-inc.hs"

    #define APPLICATIVE Vec4
    #include "ApplicativeNumeric-inc.hs"

And here are the error messages in ghci:

    Graphics/Shady/Vec.hs:134:0:
     error: ApplicativeNumeric-inc.hs: No such file or directory

    Graphics/Shady/Vec.hs:136:0:  warning: "APPLICATIVE" redefined

    Graphics/Shady/Vec.hs:133:0:
     warning: this is the location of the previous definition

    Graphics/Shady/Vec.hs:139:0:  warning: "APPLICATIVE" redefined

    Graphics/Shady/Vec.hs:136:0:
     warning: this is the location of the previous definition

    Graphics/Shady/Vec.hs:142:0:  warning: "APPLICATIVE" redefined

    Graphics/Shady/Vec.hs:139:0:
     warning: this is the location of the previous definition
    phase `C pre-processor' failed (exitcode = 1)

Any ideas?  Suggestions?

  - Conal
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to