summaryrefslogtreecommitdiff
path: root/compiler/cbits
diff options
context:
space:
mode:
authorPatrick Palka <patrick@parcs.ath.cx>2013-09-04 14:49:51 -0400
committerPatrick Palka <patrick@parcs.ath.cx>2013-09-04 14:58:59 -0400
commit1f5338e7b71f56c6d2451b9b23608c851bf90c8a (patch)
treea385e159c26f14eb592e18a062d953424d774326 /compiler/cbits
parent81bafceb14dfae45a59566c232b6b6eb4e4ffd09 (diff)
downloadhaskell-1f5338e7b71f56c6d2451b9b23608c851bf90c8a.tar.gz
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.
Diffstat (limited to 'compiler/cbits')
-rw-r--r--compiler/cbits/genSym.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/cbits/genSym.c b/compiler/cbits/genSym.c
index 4217e636e1..08d403d849 100644
--- a/compiler/cbits/genSym.c
+++ b/compiler/cbits/genSym.c
@@ -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
}