Adjust build fix from r199494 to use C++ casts

Change suggested by Joerg Sonnenberger!

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199500 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alp Toker 2014-01-17 16:17:24 +00:00
parent 5f58b89ecd
commit 63fbfd6883

View File

@ -79,7 +79,7 @@ __libcpp_nmstr::operator=(const __libcpp_nmstr& s) _NOEXCEPT
const char* p = str_;
str_ = s.str_;
__sync_add_and_fetch(&count(), 1);
if (__sync_add_and_fetch((count_t*)(p-sizeof(count_t)), count_t(-1)) < 0)
if (__sync_add_and_fetch(reinterpret_cast<count_t*>(const_cast<char*>(p)-sizeof(count_t)), count_t(-1)) < 0)
delete [] (p-offset);
return *this;
}