summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-01-21 11:30:24 +0100
committerBen Gamari <ben@smart-cactus.org>2016-01-21 14:59:06 +0100
commit928484d2b021fc968d5f2dfe490dc0ad201dc7df (patch)
tree3ef748106317248d4e2d586acf0cb08a7b00d7f0
parentf23b578f792a357fa754604188eea46ca46cf613 (diff)
downloadhaskell-928484d2b021fc968d5f2dfe490dc0ad201dc7df.tar.gz
user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro
And fix markup.
-rw-r--r--docs/users_guide/intro.rst3
-rw-r--r--docs/users_guide/phases.rst8
2 files changed, 10 insertions, 1 deletions
diff --git a/docs/users_guide/intro.rst b/docs/users_guide/intro.rst
index 281c04a211..677f4625b4 100644
--- a/docs/users_guide/intro.rst
+++ b/docs/users_guide/intro.rst
@@ -175,3 +175,6 @@ numbering GHC versions:
The version number of your copy of GHC can be found by invoking ``ghc``
with the ``--version`` flag (see :ref:`options-help`).
+The compiler version can be tested within compiled code with the
+``MIN_VERSION_GLASGOW_HASKELL`` CPP macro (defined only when
+:ghc-flag:`-XCPP` is used). See :ref:`standard-cpp-macros` for details.
diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst
index bc4e90f3a9..e9637fac69 100644
--- a/docs/users_guide/phases.rst
+++ b/docs/users_guide/phases.rst
@@ -182,6 +182,11 @@ Options affecting the C pre-processor
The GHC driver pre-defines several macros when processing Haskell source
code (``.hs`` or ``.lhs`` files).
+.. _standard-cpp-macros:
+
+Standard CPP macros
+~~~~~~~~~~~~~~~~~~~
+
The symbols defined by GHC are listed below. To check which symbols are
defined by your local GHC installation, the following trick is useful:
@@ -258,7 +263,7 @@ defined by your local GHC installation, the following trick is useful:
is required, the presence of the ``MIN_VERSION_GLASGOW_HASKELL``
macro needs to be ensured before it is called, e.g.:
- .. code-block: c
+ .. code-block:: c
#ifdef MIN_VERSION_GLASGOW_HASKELL
#if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0)
@@ -451,6 +456,7 @@ Options affecting code generation
no-op on that platform.
.. ghc-flag:: -dynamic
+ :noindex:
When generating code, assume that entities imported from a different
package will reside in a different shared library or binary.