summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-06-08 18:48:36 +0100
committerIan Lynagh <igloo@earth.li>2011-06-08 18:48:36 +0100
commit417f4d59739cc478ca47d081c22d7b0a928c4e95 (patch)
treea9d0c6d4b88ec0651d00470107373bd384a9235e
parent9932074a7c841eb76518a3abb3246e9f1d81886e (diff)
downloadhaskell-417f4d59739cc478ca47d081c22d7b0a928c4e95.tar.gz
Add a target32Bit function to Platform
-rw-r--r--compiler/utils/Platform.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index b240a0bd94..8f07b471bb 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -9,11 +9,14 @@ module Platform (
OS(..),
defaultTargetPlatform,
+ target32Bit,
osElfTarget
)
where
+import Panic
+
#include "HsVersions.h"
@@ -52,6 +55,16 @@ data OS
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