diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-06-10 21:07:00 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-06-10 21:07:00 +0200 |
commit | a9e791823e749bfe9ff1a9ebfab66e1d0112572c (patch) | |
tree | 54974f11a4d31d978892441ccf6945b21a543735 /lib/system/atomics.nim | |
parent | 291e3b90f42a6ea17aaa031c4b5fda1a90df6303 (diff) | |
parent | 891d953a4cd0be4693204e3d62ae7a22ec89aba9 (diff) | |
download | Nim-a9e791823e749bfe9ff1a9ebfab66e1d0112572c.tar.gz |
Merge pull request #2891 from sstirlin/devel
fixed threadpool and atomics to work with Visual Studio 32 and 64 bit
Diffstat (limited to 'lib/system/atomics.nim')
-rw-r--r-- | lib/system/atomics.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/atomics.nim b/lib/system/atomics.nim index 0b16b63bf..158fe91bc 100644 --- a/lib/system/atomics.nim +++ b/lib/system/atomics.nim @@ -191,11 +191,11 @@ proc atomicDec*(memLoc: var int, x: int = 1): int = result = memLoc when defined(windows) and not someGcc: - proc interlockedCompareExchange(p: pointer; exchange, comparand: int32): int32 + proc interlockedCompareExchange(p: pointer; exchange, comparand: int): int {.importc: "InterlockedCompareExchange", header: "<windows.h>", cdecl.} proc cas*[T: bool|int|ptr](p: ptr T; oldValue, newValue: T): bool = - interlockedCompareExchange(p, newValue.int32, oldValue.int32) != 0 + interlockedCompareExchange(p, cast[int](newValue), cast[int](oldValue)) != 0 # XXX fix for 64 bit build else: # this is valid for GCC and Intel C++ |