From 417f4d59739cc478ca47d081c22d7b0a928c4e95 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 8 Jun 2011 18:48:36 +0100 Subject: [PATCH] Add a target32Bit function to Platform --- compiler/utils/Platform.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs index b240a0b..8f07b47 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 -- 1.7.10.4