diff options
author | Howard Hinnant <hhinnant@apple.com> | 2013-02-07 19:27:39 +0400 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2013-02-07 19:27:39 +0400 |
commit | 804f9116e5ed05b5a9f2a3f955c480480967c269 (patch) | |
tree | 97d28316ead8a5befc7660c073577e8f44beaa1b /libcxx/include/string | |
parent | e94f4c048edba72a276e3632196aa96dbe1ee6a6 (diff) |
Michael van der Westhuizen: The attached patch add support for building against libc++abi and libcxxrt to CMake builds of libc++.
Usage (with the appropriate CC and CXX environment variables) is:
$ cmake -DLIBCXX_CXX_ABI=libcxxabi '-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=/home/michael/libcxxabi/include' ../libcxx
and:
$ cmake -DLIBCXX_CXX_ABI=libcxxrt '-DLIBCXX_LIBCXXRT_INCLUDE_PATHS=/home/michael/libcxxrt/src' ../libcxx
llvm-svn: 174623
Diffstat (limited to 'libcxx/include/string')
-rw-r--r-- | libcxx/include/string | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libcxx/include/string b/libcxx/include/string index 1a70467940c7..c99eaeaebe33 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -2067,10 +2067,13 @@ basic_string<_CharT, _Traits, _Allocator>::__grow_by(size_type __old_cap, size_t pointer __p = __alloc_traits::allocate(__alloc(), __cap+1); __invalidate_all_iterators(); if (__n_copy != 0) - traits_type::copy(__p, __old_p, __n_copy); + traits_type::copy(_VSTD::__to_raw_pointer(__p), + _VSTD::__to_raw_pointer(__old_p), __n_copy); size_type __sec_cp_sz = __old_sz - __n_del - __n_copy; if (__sec_cp_sz != 0) - traits_type::copy(__p + __n_copy + __n_add, __old_p + __n_copy + __n_del, __sec_cp_sz); + traits_type::copy(_VSTD::__to_raw_pointer(__p + __n_copy + __n_add), + _VSTD::__to_raw_pointer(__old_p + __n_copy + __n_del), + __sec_cp_sz); if (__old_cap+1 != __min_cap) __alloc_traits::deallocate(__alloc(), __old_p, __old_cap+1); __set_long_pointer(__p); @@ -2303,7 +2306,7 @@ basic_string<_CharT, _Traits, _Allocator>::append(size_type __n, value_type __c) if (__cap - __sz < __n) __grow_by(__cap, __sz + __n - __cap, __sz, __sz, 0); pointer __p = __get_pointer(); - traits_type::assign(__p + __sz, __n, __c); + traits_type::assign(_VSTD::__to_raw_pointer(__p + __sz), __n, __c); __sz += __n; __set_size(__sz); traits_type::assign(__p[__sz], value_type()); |