[Haskell-cafe] different code in different platforms

José Miguel Vilaça jmvilaca at di.uminho.pt
Wed Mar 15 10:02:16 EST 2006

Sorry. In the previous email I forgot the subject.




I’m having a small problem with the portability of my Haskell code. My code
uses wxHaskell and the library for which this one is the Haskell interface
(that is called wxWidgets) doesn’t work in the same away in Windows and


Now I now which code run in Linux and in Windows but I don’t want to have to
manually change the file in each platform.

I tried a solution using the C pre-processor but I getting in trouble.


I use code like:


#ifdef __WIN32__

    (Windows code)


    (Linux code)



I also add the --cpp to the ghc and it works for me in Linux but give me
linking errors in Windows.


Does someone have any hints on how to have different code in Windows and


I would be thankful in some help.


Best regards


Miguel Vilaça


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20060315/b264b913/attachment.htm

More information about the Haskell-Cafe mailing list