How to use #ifdef WIN32

Jim Burton jim at
Thu Dec 20 19:37:15 EST 2007

I want to switch code on the OS but this always goes through to the #else (on
windows or elsewhere):

{-# OPTIONS -cpp #-}
#ifdef WIN32
main = putStrLn "hello windows"
main = putStrLn "hello something else"

Does this depend on a Makefile setting WIN32, or should there be something

View this message in context:
Sent from the Haskell - Glasgow-haskell-users mailing list archive at

More information about the Glasgow-haskell-users mailing list