projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9932074
)
Add a target32Bit function to Platform
author
Ian Lynagh
<igloo@earth.li>
Wed, 8 Jun 2011 17:48:36 +0000
(18:48 +0100)
committer
Ian Lynagh
<igloo@earth.li>
Wed, 8 Jun 2011 17:48:36 +0000
(18:48 +0100)
compiler/utils/Platform.hs
patch
|
blob
|
history
diff --git
a/compiler/utils/Platform.hs
b/compiler/utils/Platform.hs
index
b240a0b
..
8f07b47
100644
(file)
--- a/
compiler/utils/Platform.hs
+++ b/
compiler/utils/Platform.hs
@@
-9,11
+9,14
@@
module Platform (
OS(..),
defaultTargetPlatform,
OS(..),
defaultTargetPlatform,
+ target32Bit,
osElfTarget
)
where
osElfTarget
)
where
+import Panic
+
#include "HsVersions.h"
#include "HsVersions.h"
@@
-52,6
+55,16
@@
data OS
deriving (Show, Eq)
deriving (Show, Eq)
+target32Bit :: Platform -> Bool
+target32Bit p = case platformArch p of
+ ArchUnknown -> panic "Don't know if ArchUnknown is 32bit"
+ ArchX86 -> True
+ ArchX86_64 -> False
+ ArchPPC -> True
+ ArchPPC_64 -> False
+ ArchSPARC -> True
+
+
-- | This predicates tells us whether the OS supports ELF-like shared libraries.
osElfTarget :: OS -> Bool
osElfTarget OSLinux = True
-- | This predicates tells us whether the OS supports ELF-like shared libraries.
osElfTarget :: OS -> Bool
osElfTarget OSLinux = True