diff options
author | simonmar <unknown> | 2005-01-28 13:36:34 +0000 |
---|---|---|
committer | simonmar <unknown> | 2005-01-28 13:36:34 +0000 |
commit | 2940ff3f0ca9aa4a4522ee61fea054052921c397 (patch) | |
tree | ee318335bbdc5d44e3dd51918d93c0c6a8de1edf /libraries/base/System/Info.hs | |
parent | 3a682aa855ace3304e7ce1c7bd965316053ebb25 (diff) | |
download | haskell-2940ff3f0ca9aa4a4522ee61fea054052921c397.tar.gz |
[project @ 2005-01-28 13:36:25 by simonmar]
Catch up with updates to platform #defines.
Generally: use _HOST_ rather than _TARGET_ (except in Cabal where we
have to retain compatibility with previous GHC versions).
Diffstat (limited to 'libraries/base/System/Info.hs')
-rw-r--r-- | libraries/base/System/Info.hs | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/libraries/base/System/Info.hs b/libraries/base/System/Info.hs index 02cd45de0b..dfb30188d4 100644 --- a/libraries/base/System/Info.hs +++ b/libraries/base/System/Info.hs @@ -13,20 +13,21 @@ -- ----------------------------------------------------------------------------- -#ifndef __NHC__ -#include "MachDeps.h" -#endif - module System.Info ( os, -- :: String - arch -- :: String + arch, -- :: String + compilerName, -- :: String + compilerVersion -- :: Version ) where import Prelude +import Data.Version #ifndef __NHC__ +#include "ghcplatform.h" + arch :: String arch = HOST_ARCH @@ -37,3 +38,20 @@ os = HOST_OS os,arch ::String #include "OSInfo.hs" #endif + +compilerName :: String +#if defined(__NHC__) +compilerName = "nhc98" +#elif defined(__GLASGOW_HASKELL__) +compilerName = "ghc" +#elif defined(__HUGS__) +compilerName = "hugs" +#else +#error Unknown compiler name +#endif + +compilerVersion :: Version +#ifdef __GLASGOW_HASKELL__ +compilerVersion = Version {versionBranch=[maj,min], versionTags=[]} + where (maj,min) = __GLASGOW_HASKELL__ `divMod` 100 +#endif |