summaryrefslogtreecommitdiff
path: root/libraries/ghci/GHCi/InfoTable.hsc
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2019-05-06 18:49:33 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-06-11 18:40:37 -0400
commit39f50bff3ea913a7f4b1d915660bcf77b9327e2e (patch)
tree333057c89bb94838cd12cf03deb7e7a5dda83339 /libraries/ghci/GHCi/InfoTable.hsc
parentfe7e7e4a950a77326cc16f4ade30a67d20d7cdd5 (diff)
downloadhaskell-39f50bff3ea913a7f4b1d915660bcf77b9327e2e.tar.gz
Refine the GHCI macro into HAVE[_{INTERNAL, EXTERNAL}]_INTERPRETER
As discussed in #16331, the GHCI macro, defined through 'ghci' flags in ghc.cabal.in, ghc-bin.cabal.in and ghci.cabal.in, is supposed to indicate whether GHC is built with support for an internal interpreter, that runs in the same process. It is however overloaded in a few places to mean "there is an interpreter available", regardless of whether it's an internal or external interpreter. For the sake of clarity and with the hope of more easily being able to build stage 1 GHCs with external interpreter support, this patch splits the previous GHCI macro into 3 different ones: - HAVE_INTERNAL_INTERPRETER: GHC is built with an internal interpreter - HAVE_EXTERNAL_INTERPRETER: GHC is built with support for external interpreters - HAVE_INTERPRETER: HAVE_INTERNAL_INTERPRETER || HAVE_EXTERNAL_INTERPRETER
Diffstat (limited to 'libraries/ghci/GHCi/InfoTable.hsc')
-rw-r--r--libraries/ghci/GHCi/InfoTable.hsc10
1 files changed, 5 insertions, 5 deletions
diff --git a/libraries/ghci/GHCi/InfoTable.hsc b/libraries/ghci/GHCi/InfoTable.hsc
index 87d8f8f167..826e3bc2fd 100644
--- a/libraries/ghci/GHCi/InfoTable.hsc
+++ b/libraries/ghci/GHCi/InfoTable.hsc
@@ -10,13 +10,13 @@
--
module GHCi.InfoTable
(
-#ifdef GHCI
+#if defined(HAVE_INTERPRETER)
mkConInfoTable
#endif
) where
import Prelude -- See note [Why do we import Prelude here?]
-#ifdef GHCI
+#if defined(HAVE_INTERPRETER)
import Foreign
import Foreign.C
import GHC.Ptr
@@ -27,13 +27,13 @@ import qualified Data.ByteString as BS
#endif
ghciTablesNextToCode :: Bool
-#ifdef TABLES_NEXT_TO_CODE
+#if defined(TABLES_NEXT_TO_CODE)
ghciTablesNextToCode = True
#else
ghciTablesNextToCode = False
#endif
-#ifdef GHCI /* To end */
+#if defined(HAVE_INTERPRETER) /* To end */
-- NOTE: Must return a pointer acceptable for use in the header of a closure.
-- If tables_next_to_code is enabled, then it must point the the 'code' field.
-- Otherwise, it should point to the start of the StgInfoTable.
@@ -387,4 +387,4 @@ wORD_SIZE = (#const SIZEOF_HSINT)
conInfoTableSizeB :: Int
conInfoTableSizeB = wORD_SIZE + itblSize
-#endif /* GHCI */
+#endif /* HAVE_INTERPRETER */