diff options
Diffstat (limited to 'lib/System')
-rw-r--r-- | lib/System/Atomic.cpp | 2 | ||||
-rw-r--r-- | lib/System/Host.cpp | 10 | ||||
-rw-r--r-- | lib/System/Unix/Path.inc | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/System/Atomic.cpp b/lib/System/Atomic.cpp index f9b55a186d18..7ba8b774d5e0 100644 --- a/lib/System/Atomic.cpp +++ b/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 diff --git a/lib/System/Host.cpp b/lib/System/Host.cpp index e112698349ee..79897e48bdaa 100644 --- a/lib/System/Host.cpp +++ b/lib/System/Host.cpp @@ -103,11 +103,8 @@ static void DetectX86FamilyModel(unsigned EAX, unsigned &Family, unsigned &Model Model += ((EAX >> 16) & 0xf) << 4; // Bits 16 - 19 } } -#endif - std::string sys::getHostCPUName() { -#if defined(__x86_64__) || defined(__i386__) unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0; if (GetX86CpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX)) return "generic"; @@ -295,7 +292,10 @@ std::string sys::getHostCPUName() { return "generic"; } } -#endif - return "generic"; } +#else +std::string sys::getHostCPUName() { + return "generic"; +} +#endif diff --git a/lib/System/Unix/Path.inc b/lib/System/Unix/Path.inc index ff1497a5c6df..33b26f7e8425 100644 --- a/lib/System/Unix/Path.inc +++ b/lib/System/Unix/Path.inc @@ -77,7 +77,7 @@ inline bool lastIsSlash(const std::string& path) { namespace llvm { using namespace sys; -extern const char sys::PathSeparator = ':'; +const char sys::PathSeparator = ':'; Path::Path(const std::string& p) : path(p) {} |