Skip to content

Commit cfe9053

Browse files
fix multiple declarations of ghc_unique_counter64 (#596)
1 parent 53365c5 commit cfe9053

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ghc-lib-gen/src/Ghclibgen.hs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -963,11 +963,15 @@ mangleCSymbols ghcFlavor = do
963963
. prefixSymbol genSym
964964
. prefixSymbol initGenSym
965965
=<< readFile' file
966-
when (ghcFlavor <= Ghc9121) $
967-
let file = "compiler/cbits/genSym.c"
968-
in writeFile file
969-
. replace "#if !MIN_VERSION_GLASGOW_HASKELL(9,8,4,0)" "#if !MIN_VERSION_GLASGOW_HASKELL(9,6,7,0)"
970-
=<< readFile' file
966+
let file = "compiler/cbits/genSym.c"
967+
replacement = "#if !MIN_VERSION_GLASGOW_HASKELL(9,6,7,0)\n"
968+
<> "HsWord64 ghc_unique_counter64 = 0;\n"
969+
<> "#elif MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) "
970+
<> "&& !MIN_VERSION_GLASGOW_HASKELL(9,8,4,0)"
971+
in writeFile file
972+
. replace "#if !MIN_VERSION_GLASGOW_HASKELL(9,8,4,0)" replacement
973+
. replace "#if !MIN_VERSION_GLASGOW_HASKELL(9,9,0,0)" replacement
974+
=<< readFile' file
971975
when (ghcFlavor == Ghc984) $
972976
let file = "compiler/cbits/genSym.c"
973977
in writeFile file

0 commit comments

Comments
 (0)