Commit 1f5338e7 authored by parcs's avatar parcs

Fix bootstrapping of GHC with earlier versions

We can no longer use atomic_inc() in the stage1 compiler because its
prototype was recently changed.

Since the stage1 compiler is always single-threaded, only use
atomic_inc() when THREADED_RTS is defined.
parent 81bafceb
......@@ -4,10 +4,14 @@
static HsInt GenSymCounter = 0;
HsInt genSym(void) {
#if defined(THREADED_RTS)
if (n_capabilities == 1) {
return GenSymCounter++;
} else {
return atomic_inc((StgWord *)&GenSymCounter, 1);
}
#else
return GenSymCounter++;
#endif
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment