Core: BSD/clang patch (thanks SenderGhost)

git-svn-id: svn://ultimatepp.org/upp/trunk@7803 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-10-20 18:17:41 +00:00
parent 00835b92be
commit 920cb4f81d
4 changed files with 16 additions and 8 deletions

View file

@ -34,7 +34,6 @@ file
config.h,
Defs.h,
Cpu.cpp optimize_speed,
Mt.h,
Mt.cpp,
OL_Set.cpp,
Global.h,
@ -49,6 +48,7 @@ file
StringFind.cpp,
String.cpp optimize_speed,
WString.cpp optimize_speed,
Mt.h,
StrUtil.cpp optimize_speed,
SplitMerge.h,
SplitMerge.cpp optimize_speed,

View file

@ -278,9 +278,21 @@ public:
#ifdef PLATFORM_POSIX
#if !(defined(PLATFORM_BSD) && defined(__clang__))
typedef _Atomic_word Atomic;
#else
typedef int Atomic;
#endif
inline int AtomicXAdd(volatile Atomic& t, int incr) { using namespace __gnu_cxx; return __exchange_and_add(&t, incr); }
inline int AtomicXAdd(volatile Atomic& t, int incr)
{
#if !(defined(PLATFORM_BSD) && defined(__clang__))
using namespace __gnu_cxx;
return __exchange_and_add(&t, incr);
#else
return __sync_fetch_and_add(&t, incr);
#endif
}
inline int AtomicInc(volatile Atomic& t) { return AtomicXAdd(t, +1) + 1; }
inline int AtomicDec(volatile Atomic& t) { return AtomicXAdd(t, -1) - 1; }

View file

@ -3,12 +3,11 @@ uses
file
lz4.h,
lz4upp.cpp,
lz4upp.cpp optimize_speed,
util.cpp,
lib\lz4.c optimize_speed,
lib\lz4.h,
lib\LICENSE,
result.txt;
lib\LICENSE;
mainconfig
"" = "SSE2";

View file

@ -1,3 +0,0 @@
Compress 2.422
Decompress 1.672
-------------