(no subject)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

José Miguel Vilaça

Hi

 

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 Linux.

 

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)

#else

    (Linux code)

#endif

 

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 Linux?

 

I would be thankful in some help.

 

Best regards

 

Miguel Vilaça


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: (no subject)

Bulat Ziganshin-2
Hello José,

Wednesday, March 15, 2006, 5:54:49 PM, you wrote:

JMV> #ifdef __WIN32__

i use the following:

#if defined(mingw32_HOST_OS) || defined(__MINGW32__) || defined(_MSC_VER)


--
Best regards,
 Bulat                            mailto:[hidden email]

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe