X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FUtil.lhs;h=db6f96a206d92315186ca3f777268bcf5edb83fe;hb=960b35ddc178f6b8af1a8809aecb0a43177abbc8;hp=83d7cc8241ce1397b25127373914f4f9eedcb47a;hpb=09c5039866fcd4f58424cb40f67049a373d98055;p=ghc-hetmet.git diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index 83d7cc8..db6f96a 100644 --- a/compiler/utils/Util.lhs +++ b/compiler/utils/Util.lhs @@ -93,7 +93,7 @@ import Control.Monad ( unless ) import System.IO.Error as IO ( catch, isDoesNotExistError ) import System.Directory ( doesDirectoryExist, createDirectory, getModificationTime ) -import System.FilePath hiding ( searchPathSeparator ) +import System.FilePath import Data.Char ( isUpper, isAlphaNum, isSpace, ord, isDigit ) import Data.Ratio ( (%) ) import System.Time ( ClockTime ) @@ -107,6 +107,15 @@ infixr 9 `thenCmp` %* * %************************************************************************ +These booleans are global constants, set by CPP flags. They allow us to +recompile a single module (this one) to change whether or not debug output +appears. They sometimes let us avoid even running CPP elsewhere. + +It's important that the flags are literal constants (True/False). Then, +with -0, tests of the flags in other modules will simplify to the correct +branch of the conditional, thereby dropping debug code altogether when +the flags are off. + \begin{code} ghciSupported :: Bool #ifdef GHCI @@ -874,17 +883,7 @@ parseSearchPath path = split path #endif _ -> chunk' - (chunk', rest') = break (==searchPathSeparator) s - --- | A platform-specific character used to separate search path strings in --- environment variables. The separator is a colon (\":\") on Unix and --- Macintosh, and a semicolon (\";\") on the Windows operating system. -searchPathSeparator :: Char -#if mingw32_HOST_OS || mingw32_TARGET_OS -searchPathSeparator = ';' -#else -searchPathSeparator = ':' -#endif + (chunk', rest') = break isSearchPathSeparator s data Direction = Forwards | Backwards