From: Ian Lynagh Date: Sat, 14 Jun 2008 20:42:34 +0000 (+0000) Subject: Remove more ifdeffery X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=43d9be898eadb04950bc0b0b272e0f05aedb463d Remove more ifdeffery --- diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index 759469f..0d98fb9 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -230,13 +230,12 @@ dataConInfoPtrToName x = do -} getConDescAddress :: Ptr StgInfoTable -> IO (Ptr Word8) - getConDescAddress ptr = do -#ifdef GHCI_TABLES_NEXT_TO_CODE + getConDescAddress ptr + | ghciTablesNextToCode = do offsetToString <- peek $ ptr `plusPtr` (- wORD_SIZE) return $ (ptr `plusPtr` stdInfoTableSizeB) `plusPtr` (fromIntegral (offsetToString :: StgWord)) -#else + | otherwise = peek $ intPtrToPtr $ (ptrToIntPtr ptr) + fromIntegral stdInfoTableSizeB -#endif -- parsing names is a little bit fiddly because we have a string in the form: -- pkg:A.B.C.foo, and we want to split it into three parts: ("pkg", "A.B.C", "foo"). diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index 9bae07f..1ecf82c 100644 --- a/compiler/utils/Util.lhs +++ b/compiler/utils/Util.lhs @@ -6,7 +6,8 @@ \begin{code} module Util ( - debugIsOn, isWindowsHost, isWindowsTarget, isDarwinTarget, + debugIsOn, ghciTablesNextToCode, + isWindowsHost, isWindowsTarget, isDarwinTarget, -- general list processing zipEqual, zipWithEqual, zipWith3Equal, zipWith4Equal, @@ -118,6 +119,13 @@ debugIsOn = True debugIsOn = False #endif +ghciTablesNextToCode :: Bool +#ifdef GHCI_TABLES_NEXT_TO_CODE +ghciTablesNextToCode = True +#else +ghciTablesNextToCode = False +#endif + isWindowsHost :: Bool #ifdef mingw32_HOST_OS isWindowsHost = True