mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
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:
parent
00835b92be
commit
920cb4f81d
4 changed files with 16 additions and 8 deletions
|
|
@ -34,7 +34,6 @@ file
|
||||||
config.h,
|
config.h,
|
||||||
Defs.h,
|
Defs.h,
|
||||||
Cpu.cpp optimize_speed,
|
Cpu.cpp optimize_speed,
|
||||||
Mt.h,
|
|
||||||
Mt.cpp,
|
Mt.cpp,
|
||||||
OL_Set.cpp,
|
OL_Set.cpp,
|
||||||
Global.h,
|
Global.h,
|
||||||
|
|
@ -49,6 +48,7 @@ file
|
||||||
StringFind.cpp,
|
StringFind.cpp,
|
||||||
String.cpp optimize_speed,
|
String.cpp optimize_speed,
|
||||||
WString.cpp optimize_speed,
|
WString.cpp optimize_speed,
|
||||||
|
Mt.h,
|
||||||
StrUtil.cpp optimize_speed,
|
StrUtil.cpp optimize_speed,
|
||||||
SplitMerge.h,
|
SplitMerge.h,
|
||||||
SplitMerge.cpp optimize_speed,
|
SplitMerge.cpp optimize_speed,
|
||||||
|
|
|
||||||
|
|
@ -278,9 +278,21 @@ public:
|
||||||
|
|
||||||
#ifdef PLATFORM_POSIX
|
#ifdef PLATFORM_POSIX
|
||||||
|
|
||||||
|
#if !(defined(PLATFORM_BSD) && defined(__clang__))
|
||||||
typedef _Atomic_word Atomic;
|
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 AtomicInc(volatile Atomic& t) { return AtomicXAdd(t, +1) + 1; }
|
||||||
inline int AtomicDec(volatile Atomic& t) { return AtomicXAdd(t, -1) - 1; }
|
inline int AtomicDec(volatile Atomic& t) { return AtomicXAdd(t, -1) - 1; }
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,11 @@ uses
|
||||||
|
|
||||||
file
|
file
|
||||||
lz4.h,
|
lz4.h,
|
||||||
lz4upp.cpp,
|
lz4upp.cpp optimize_speed,
|
||||||
util.cpp,
|
util.cpp,
|
||||||
lib\lz4.c optimize_speed,
|
lib\lz4.c optimize_speed,
|
||||||
lib\lz4.h,
|
lib\lz4.h,
|
||||||
lib\LICENSE,
|
lib\LICENSE;
|
||||||
result.txt;
|
|
||||||
|
|
||||||
mainconfig
|
mainconfig
|
||||||
"" = "SSE2";
|
"" = "SSE2";
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
Compress 2.422
|
|
||||||
Decompress 1.672
|
|
||||||
-------------
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue