More Windows support, from <shelarcy capella.freemail.ne.jp>

This commit is contained in:
dons
2005-05-13 01:54:49 +00:00
parent 98ea2802c9
commit a1529d9003
4 changed files with 33 additions and 7 deletions

View File

@ -22,6 +22,13 @@ module Plugins.Consts where
#include "../../../config.h"
#if __GLASGOW_HASKELL__ >= 604
import System.Directory ( getTemporaryDirectory )
import System.IO.Unsafe ( unsafePerformIO )
#endif
-- | path to *build* dir, used by eval() for testing the examples
top = TOP
@ -40,7 +47,7 @@ sysPkgSuffix = ".o"
objSuf = sysPkgSuffix
hiSuf = ".hi"
hsSuf = ".hs"
#ifdef CYGWIN
#if defined(CYGWIN) || defined(__MINGW32__)
dllSuf = ".dll"
#else
dllSuf = ".so"
@ -59,9 +66,14 @@ prefixUnderscore = ""
#endif
-- | Define tmpDir to where tmp files should be created on your platform
#if __GLASGOW_HASKELL__ >= 604
tmpDir = unsafePerformIO getTemporaryDirectory
{-# NOINLINE tmpDir #-}
#else
#if !defined(__MINGW32__)
tmpDir = "/tmp"
#else
tmpDir = error "tmpDir not defined for this platform. Try setting the TMPDIR env var"
#endif
#endif

View File

@ -243,7 +243,11 @@ unify obj incs args ty sym = do
i = "-i" ++ dirname obj -- plugin
hWrite hdl src
#if defined(CYGWIN) || defined(__MINGW32__)
e <- build tmpf "nul" (i:is++args++["-fno-code","-ohi nul"])
#else
e <- build tmpf "/dev/null" (i:is++args++["-fno-code","-ohi/dev/null"])
#endif
removeFile tmpf
return e