From: simonmar Date: Wed, 18 May 2005 09:43:50 +0000 (+0000) Subject: [project @ 2005-05-18 09:43:50 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~521 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=35eb7d56c0feafae71c35726925d6cd3bb7bb7c5;p=ghc-hetmet.git [project @ 2005-05-18 09:43:50 by simonmar] Fix and hopefully rationalise the #ifdefs for rawSystem/system/runProcess. --- diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs index 0794503..c7883b0 100644 --- a/ghc/utils/hsc2hs/Main.hs +++ b/ghc/utils/hsc2hs/Main.hs @@ -1,7 +1,7 @@ {-# OPTIONS -fffi -cpp #-} ------------------------------------------------------------------------ --- $Id: Main.hs,v 1.73 2005/05/17 09:48:27 krasimir Exp $ +-- $Id: Main.hs,v 1.74 2005/05/18 09:43:50 simonmar Exp $ -- -- Program for converting .hsc files to .hs files, by converting the -- file into a C program which is run to generate the Haskell source. @@ -38,23 +38,27 @@ import CString #endif -#if defined(__GLASGOW_HASKELL__) && !defined(BUILD_NHC) - -import Compat.RawSystem ( rawSystem ) +#if __GLASGOW_HASKELL__ >= 604 import System.Process ( runProcess, waitForProcess ) import System.IO ( openFile, IOMode(..), hClose ) -#define HAVE_rawSystem #define HAVE_runProcess +#endif -#elif __HUGS__ || __NHC__ >= 117 || __GLASGOW_HASKELL__ >= 600 - -import System.Cmd ( system, rawSystem ) +#if defined(__GLASGOW_HASKELL__) && !defined(BUILD_NHC) +import Compat.RawSystem ( rawSystem ) +#define HAVE_rawSystem +#elif __HUGS__ || __NHC__ >= 117 +import System.Cmd ( rawSystem ) #define HAVE_rawSystem +#endif +#if !defined(HAVE_runProcess) || !defined(HAVE_rawSystem) +-- we need system +#if __HUGS__ || __NHC__ >= 117 || __GLASGOW_HASKELL__ >= 600 +import System.Cmd ( system ) #else - import System ( system ) - +#endif #endif version :: String