diff options
author | Patrick Palka <patrick@parcs.ath.cx> | 2013-09-04 14:49:51 -0400 |
---|---|---|
committer | Patrick Palka <patrick@parcs.ath.cx> | 2013-09-04 14:58:59 -0400 |
commit | 1f5338e7b71f56c6d2451b9b23608c851bf90c8a (patch) | |
tree | a385e159c26f14eb592e18a062d953424d774326 /compiler/cbits | |
parent | 81bafceb14dfae45a59566c232b6b6eb4e4ffd09 (diff) | |
download | haskell-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.c | 4 |
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 } |