Commit c211f8e5 authored by Joachim Breitner's avatar Joachim Breitner Committed by Austin Seipp

Add __GLASGOW_HASKELL_TH__=YES/NO to CPP definitions

Test Plan: None really.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, simonmar

Differential Revision: https://phabricator.haskell.org/D386

GHC Trac Issues: #9734
parent 3d27f697
......@@ -2100,6 +2100,11 @@ doCpp dflags raw input_fn output_fn = do
backend_defs <- getBackendDefs dflags
#ifdef GHCI
let th_defs = [ "-D__GLASGOW_HASKELL_TH__=YES" ]
#else
let th_defs = [ "-D__GLASGOW_HASKELL_TH__=NO" ]
#endif
-- Default CPP defines in Haskell source
ghcVersionH <- getGhcVersionPathName dflags
let hsSourceCppOpts =
......@@ -2112,6 +2117,7 @@ doCpp dflags raw input_fn output_fn = do
++ map SysTools.Option hsSourceCppOpts
++ map SysTools.Option target_defs
++ map SysTools.Option backend_defs
++ map SysTools.Option th_defs
++ map SysTools.Option hscpp_opts
++ map SysTools.Option sse_defs
++ map SysTools.Option avx_defs
......
......@@ -466,6 +466,21 @@ $ cat foo.hspp</screen>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>&lowbar;&lowbar;GLASGOW&lowbar;HASKELL&lowbar;TH&lowbar;&lowbar;</constant>
<indexterm><primary><constant>&lowbar;&lowbar;GLASGOW&lowbar;HASKELL&lowbar;TH&lowbar;&lowbar;</constant></primary></indexterm>
</term>
<listitem>
<para>
This is set to <literal>YES</literal> when the compiler supports Template Haskell, and to
<literal>NO</literal> when not. The latter is the case for a stage-1 compiler during bootstrapping, or
on architectures where the interpreter is not available.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>&lowbar;&lowbar;GLASGOW&lowbar;HASKELL&lowbar;LLVM&lowbar;&lowbar;</constant>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment