From 7aa6ef110d8cc6626b1cf18d85a37cbac53e2795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9cate?= Date: Wed, 1 Jul 2020 23:35:39 +0200 Subject: Add the __GHC_FULL_VERSION__ CPP macro to expose the full GHC version --- hadrian/src/Rules/Generate.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hadrian/src') 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" , ""] ++ -- cgit v1.2.1