Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
328519b6
Commit
328519b6
authored
Feb 18, 2008
by
Duncan Coutts
Browse files
Eliminate use of cpp in Distribution.Compiler
parent
ea2a8b8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Distribution/Compiler.hs
View file @
328519b6
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -cpp #-}
{-# OPTIONS_NHC98 -cpp #-}
{-# OPTIONS_JHC -fcpp #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Compiler
...
...
@@ -45,20 +41,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -}
module
Distribution.Compiler
(
CompilerFlavor
(
..
),
defaultCompilerFlavor
)
where
import
System.Info
(
compilerName
)
data
CompilerFlavor
=
GHC
|
NHC
|
Hugs
|
HBC
|
Helium
|
JHC
|
OtherCompiler
String
deriving
(
Show
,
Read
,
Eq
,
Ord
)
defaultCompilerFlavor
::
Maybe
CompilerFlavor
defaultCompilerFlavor
=
#
if
defined
(
__GLASGOW_HASKELL__
)
Just
GHC
#
elif
defined
(
__NHC__
)
Just
NHC
#
elif
defined
(
__JHC__
)
Just
JHC
#
elif
defined
(
__HUGS__
)
Just
Hugs
#
else
Nothing
#
endif
defaultCompilerFlavor
=
case
compilerName
of
"ghc"
->
Just
GHC
"nhc98"
->
Just
NHC
"jhc"
->
Just
JHC
"hugs"
->
Just
Hugs
_
->
Nothing
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment