Skip to content
Snippets Groups Projects
Commit eae40e16 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

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
parent 351dea4a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment