summaryrefslogtreecommitdiff
path: root/compiler/main/DriverPipeline.hs
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-12-31 21:02:50 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2015-12-31 21:08:25 +0100
commiteae40e16a0933fe3b6cb0ee4dc9cdbe3d21e44ce (patch)
treec6f7fe97e9b22fbed51da5da0ba22d08f116efeb /compiler/main/DriverPipeline.hs
parent351dea4a7c07f4e845eac6c2e895f6f41524b40c (diff)
downloadhaskell-eae40e16a0933fe3b6cb0ee4dc9cdbe3d21e44ce.tar.gz
Use 0/1 instead of YES/NO as `__GLASGOW_HASKELL_TH__` macro value
Using `YES`/`NO` causes all sorts of problems as CPP doesn't work on symbolic tokens but rather on scalar values. A use like #if __GLASGOW_HASKELL_TH__==YES {-# LANGUAGE TemplateHaskell #-} #endif doesn't do what one may naively expect, and neither does #if __GLASGOW_HASKELL_TH__ {-# LANGUAGE TemplateHaskell #-} #endif *unless* `YES` happens to evaluate to a non-zero scalar. `__GLASGOW_HASKELL_TH__ was originally introduced via D396 / #9734. Fixes #11322 Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1723
Diffstat (limited to 'compiler/main/DriverPipeline.hs')
-rw-r--r--compiler/main/DriverPipeline.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index d3038bcf7d..a6a5e1de0b 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -2024,9 +2024,9 @@ doCpp dflags raw input_fn output_fn = do
backend_defs <- getBackendDefs dflags
#ifdef GHCI
- let th_defs = [ "-D__GLASGOW_HASKELL_TH__=YES" ]
+ let th_defs = [ "-D__GLASGOW_HASKELL_TH__=1" ]
#else
- let th_defs = [ "-D__GLASGOW_HASKELL_TH__=NO" ]
+ let th_defs = [ "-D__GLASGOW_HASKELL_TH__=0" ]
#endif
-- Default CPP defines in Haskell source
ghcVersionH <- getGhcVersionPathName dflags