From: rrt Date: Wed, 12 Sep 2001 11:52:58 +0000 (+0000) Subject: [project @ 2001-09-12 11:52:58 by rrt] X-Git-Tag: Approximately_9120_patches~988 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=5d5ed99933e1f4388b2d0c999f9f5789e36c2518;p=ghc-hetmet.git [project @ 2001-09-12 11:52:58 by rrt] Do the ifdefery properly so it works on Unix. --- diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs index a2ba3f6..b81589e 100644 --- a/ghc/utils/hsc2hs/Main.hs +++ b/ghc/utils/hsc2hs/Main.hs @@ -1,5 +1,5 @@ ------------------------------------------------------------------------ --- $Id: Main.hs,v 1.33 2001/09/12 11:16:05 rrt Exp $ +-- $Id: Main.hs,v 1.34 2001/09/12 11:52:58 rrt 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. @@ -70,14 +70,14 @@ main = do prog <- getProgName let header = "Usage: "++prog++" [OPTIONS] INPUT.hsc [...]" args <- getArgs + let opts@(flags, files, errs) = getOpt Permute options args #ifdef mingw32_TARGET_OS h <- getModuleHandle Nothing n <- getModuleFileName h let tempName = reverse (drop (length "\\bin\\hsc2hs.exe") (reverse n)) ++ "\\template-hsc.h" -#endif - let (flags, files, errs) = getOpt Permute options args let fflags = if [t | Template t <- flags] /= [] then flags else (Template tempName) : flags let opts = (fflags, files, errs) +#endif case opts of (flags, _, _) | any isHelp flags -> putStrLn (usageInfo header options)