summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorHécate <hecate+gitlab@glitchbra.in>2020-07-01 23:35:39 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-03 17:34:36 -0400
commit7aa6ef110d8cc6626b1cf18d85a37cbac53e2795 (patch)
tree80a703c03e8fee5850954a89e84750f53c391e7f /hadrian
parent41d2649288a5debcb4c8003e54b7d3072ab951c5 (diff)
downloadhaskell-7aa6ef110d8cc6626b1cf18d85a37cbac53e2795.tar.gz
Add the __GHC_FULL_VERSION__ CPP macro to expose the full GHC version
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Rules/Generate.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 6222fcd3af..5f226f438d 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -398,6 +398,7 @@ generateGhcAutoconfH = do
generateGhcVersionH :: Expr String
generateGhcVersionH = do
trackGenerateHs
+ fullVersion <- getSetting ProjectVersion
version <- getSetting ProjectVersionInt
patchLevel1 <- getSetting ProjectPatchLevel1
patchLevel2 <- getSetting ProjectPatchLevel2
@@ -406,7 +407,10 @@ generateGhcVersionH = do
, "#define __GHCVERSION_H__"
, ""
, "#if !defined(__GLASGOW_HASKELL__)"
- , "# define __GLASGOW_HASKELL__ " ++ version
+ , "#define __GLASGOW_HASKELL__ " ++ version
+ , "#endif"
+ , "#if !defined(__GLASGOW_HASKELL_FULL_VERSION__)"
+ , "#define __GLASGOW_HASKELL_FULL_VERSION__ " ++ fullVersion
, "#endif"
, ""]
++