diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2009-12-07 05:29:59 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2009-12-07 05:29:59 +0000 |
commit | 8b6d88d2f87397d19af964a9d8e8be6ceaaeb1e6 (patch) | |
tree | d4751c543445c41b23430c095988c27816405525 /llvm/lib/System/Atomic.cpp | |
parent | c0dacee1e06ce43478e7a0124a2893977e60cb93 (diff) | |
download | bcm5719-llvm-8b6d88d2f87397d19af964a9d8e8be6ceaaeb1e6.tar.gz bcm5719-llvm-8b6d88d2f87397d19af964a9d8e8be6ceaaeb1e6.zip |
Fixes the Atomic implementation if compiled by MSVC compiler.
sys::cas_flag should be long on this platform, InterlockedAdd() is
defined only for the Itanium architecture (according to MSDN).
Patch by Michael Beck!
llvm-svn: 90748
Diffstat (limited to 'llvm/lib/System/Atomic.cpp')
-rw-r--r-- | llvm/lib/System/Atomic.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/System/Atomic.cpp b/llvm/lib/System/Atomic.cpp index f9b55a186d1..7ba8b774d5e 100644 --- a/llvm/lib/System/Atomic.cpp +++ b/llvm/lib/System/Atomic.cpp @@ -85,7 +85,7 @@ sys::cas_flag sys::AtomicAdd(volatile sys::cas_flag* ptr, sys::cas_flag val) { #elif defined(__GNUC__) return __sync_add_and_fetch(ptr, val); #elif defined(_MSC_VER) - return InterlockedAdd(ptr, val); + return InterlockedExchangeAdd(ptr, val) + val; #else # error No atomic add implementation for your platform! #endif |