Minor fixes to enable tcc
This commit is contained in:
parent
af593c2ef3
commit
6ca8478548
3 changed files with 4 additions and 4 deletions
|
|
@ -118,7 +118,7 @@ path="$lib/pure"
|
||||||
# Configuration for the GNU C/C++ compiler:
|
# Configuration for the GNU C/C++ compiler:
|
||||||
@if windows:
|
@if windows:
|
||||||
#gcc.path = r"$nim\dist\mingw\bin"
|
#gcc.path = r"$nim\dist\mingw\bin"
|
||||||
@if gcc:
|
@if gcc or tcc:
|
||||||
tlsEmulation:on
|
tlsEmulation:on
|
||||||
@end
|
@end
|
||||||
@end
|
@end
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,7 @@ proc slave(w: ptr Worker) {.thread.} =
|
||||||
await(w.taskArrived)
|
await(w.taskArrived)
|
||||||
# XXX Somebody needs to look into this (why does this assertion fail
|
# XXX Somebody needs to look into this (why does this assertion fail
|
||||||
# in Visual Studio?)
|
# in Visual Studio?)
|
||||||
when not defined(vcc): assert(not w.ready)
|
when not defined(vcc) and not defined(tcc): assert(not w.ready)
|
||||||
|
|
||||||
withLock numSlavesLock:
|
withLock numSlavesLock:
|
||||||
inc numSlavesRunning
|
inc numSlavesRunning
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ when defined(vcc):
|
||||||
else:
|
else:
|
||||||
{.error: "invalid CAS instruction".}
|
{.error: "invalid CAS instruction".}
|
||||||
|
|
||||||
elif defined(tcc) and not defined(windows):
|
elif defined(tcc):
|
||||||
when defined(amd64):
|
when defined(amd64):
|
||||||
{.emit:"""
|
{.emit:"""
|
||||||
static int __tcc_cas(int *ptr, int oldVal, int newVal)
|
static int __tcc_cas(int *ptr, int oldVal, int newVal)
|
||||||
|
|
@ -262,7 +262,7 @@ static int __tcc_cas(int *ptr, int oldVal, int newVal)
|
||||||
}
|
}
|
||||||
""".}
|
""".}
|
||||||
else:
|
else:
|
||||||
assert sizeof(int) == 4
|
#assert sizeof(int) == 4
|
||||||
{.emit:"""
|
{.emit:"""
|
||||||
static int __tcc_cas(int *ptr, int oldVal, int newVal)
|
static int __tcc_cas(int *ptr, int oldVal, int newVal)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue