
#include "Rts.h"

static HsInt GenSymCounter = 0;

HsInt genSym(void) {
    if (n_capabilities == 1) {
        return GenSymCounter++;
    } else {
        return atomic_inc((StgWord *)&GenSymCounter, 1);
    }
}



#include "Rts.h"

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
}


Fix bootstrapping of GHC with earlier versions
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.
