[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

Török Edvin edwin at clamav.net
Sun Apr 4 01:11:59 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 363aa4de5f75932ac4ab15daf698daa10ddd8245
Author: Török Edvin <edwin at clamav.net>
Date:   Fri Dec 11 22:57:23 2009 +0200

    Cherry-pick LLVM upstream commit r90748.
    
    commit 4aafc85f5a94802c121050ec113973249e295577
    Author: Oscar Fuentes <ofv at wanadoo.es>
    Date:   Mon Dec 7 05:29:59 2009 +0000
    
        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!
    
        git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90748 91177308-0d34-0410-b5e6-96231b3b80d8

diff --git a/libclamav/c++/llvm/include/llvm/System/Atomic.h b/libclamav/c++/llvm/include/llvm/System/Atomic.h
index 0c05d69..fc19369 100644
--- a/libclamav/c++/llvm/include/llvm/System/Atomic.h
+++ b/libclamav/c++/llvm/include/llvm/System/Atomic.h
@@ -20,7 +20,11 @@ namespace llvm {
   namespace sys {
     void MemoryFence();
 
+#ifdef _MSC_VER
+    typedef long cas_flag;
+#else
     typedef uint32_t cas_flag;
+#endif
     cas_flag CompareAndSwap(volatile cas_flag* ptr,
                             cas_flag new_value,
                             cas_flag old_value);
diff --git a/libclamav/c++/llvm/lib/System/Atomic.cpp b/libclamav/c++/llvm/lib/System/Atomic.cpp
index f9b55a1..7ba8b77 100644
--- a/libclamav/c++/llvm/lib/System/Atomic.cpp
+++ b/libclamav/c++/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

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list