[commit: ghc] master: user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro (928484d)

git at git.haskell.org git at git.haskell.org
Thu Jan 21 13:58:08 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/928484d2b021fc968d5f2dfe490dc0ad201dc7df/ghc

>---------------------------------------------------------------

commit 928484d2b021fc968d5f2dfe490dc0ad201dc7df
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Jan 21 11:30:24 2016 +0100

    user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro
    
    And fix markup.


>---------------------------------------------------------------

928484d2b021fc968d5f2dfe490dc0ad201dc7df
 docs/users_guide/intro.rst  | 3 +++
 docs/users_guide/phases.rst | 8 +++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/docs/users_guide/intro.rst b/docs/users_guide/intro.rst
index 281c04a..677f462 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 bc4e90f..e9637fa 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.



More information about the ghc-commits mailing list