diff --git a/libcxx/include/__hash_table b/libcxx/include/__hash_table --- a/libcxx/include/__hash_table +++ b/libcxx/include/__hash_table @@ -1571,7 +1571,7 @@ { (*__p)->__c_ = nullptr; if (--__c->end_ != __p) - memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); } } __get_db()->unlock(); @@ -2599,7 +2599,7 @@ { (*__dp)->__c_ = nullptr; if (--__c->end_ != __dp) - memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*)); + _VSTD::memmove(__dp, __dp+1, (__c->end_ - __dp)*sizeof(__i_node*)); } } __get_db()->unlock(); diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -79,7 +79,7 @@ // locale name, otherwise it will be a semicolon-separated string listing // each category. In the second case, we know at least one category won't // be what we want, so we only have to check the first case. - if (strcmp(__l.__get_locale(), __lc) != 0) { + if (_VSTD::strcmp(__l.__get_locale(), __lc) != 0) { __locale_all = _strdup(__lc); if (__locale_all == nullptr) __throw_bad_alloc(); diff --git a/libcxx/include/__string b/libcxx/include/__string --- a/libcxx/include/__string +++ b/libcxx/include/__string @@ -55,7 +55,9 @@ #include <__config> #include // for search and min -#include // For EOF. +#include // for EOF +#include // for memcpy +#include // for wmemcpy #include // for __murmur2_or_cityhash #include <__debug> @@ -375,7 +377,7 @@ { return __libcpp_is_constant_evaluated() ? _VSTD::__move_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n); + : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n); } static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT @@ -383,14 +385,14 @@ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); return __libcpp_is_constant_evaluated() ? _VSTD::__copy_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n); + : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n); } static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { return __libcpp_is_constant_evaluated() ? _VSTD::__assign_constexpr(__s, __n, __a) - : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n); + : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n); } static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT @@ -414,7 +416,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_memcmp(__s1, __s2, __n); #elif _LIBCPP_STD_VER <= 14 - return memcmp(__s1, __s2, __n); + return _VSTD::memcmp(__s1, __s2, __n); #else for (; __n; --__n, ++__s1, ++__s2) { @@ -436,7 +438,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_char_memchr(__s, to_int_type(__a), __n); #elif _LIBCPP_STD_VER <= 14 - return (const char_type*) memchr(__s, to_int_type(__a), __n); + return (const char_type*) _VSTD::memchr(__s, to_int_type(__a), __n); #else for (; __n; --__n) { @@ -478,7 +480,7 @@ { return __libcpp_is_constant_evaluated() ? _VSTD::__move_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : wmemmove(__s1, __s2, __n); + : __n == 0 ? __s1 : _VSTD::wmemmove(__s1, __s2, __n); } static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT @@ -486,14 +488,14 @@ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); return __libcpp_is_constant_evaluated() ? _VSTD::__copy_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : wmemcpy(__s1, __s2, __n); + : __n == 0 ? __s1 : _VSTD::wmemcpy(__s1, __s2, __n); } static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 char_type* assign(char_type* __s, size_t __n, char_type __a) _NOEXCEPT { return __libcpp_is_constant_evaluated() ? _VSTD::__assign_constexpr(__s, __n, __a) - : __n == 0 ? __s : wmemset(__s, __a, __n); + : __n == 0 ? __s : _VSTD::wmemset(__s, __a, __n); } static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT {return eq_int_type(__c, eof()) ? ~eof() : __c;} @@ -516,7 +518,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_wmemcmp(__s1, __s2, __n); #elif _LIBCPP_STD_VER <= 14 - return wmemcmp(__s1, __s2, __n); + return _VSTD::wmemcmp(__s1, __s2, __n); #else for (; __n; --__n, ++__s1, ++__s2) { @@ -548,7 +550,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_wcslen(__s); #elif _LIBCPP_STD_VER <= 14 - return wcslen(__s); + return _VSTD::wcslen(__s); #else size_t __len = 0; for (; !eq(*__s, char_type(0)); ++__s) @@ -566,7 +568,7 @@ #if __has_feature(cxx_constexpr_string_builtins) return __builtin_wmemchr(__s, __a, __n); #elif _LIBCPP_STD_VER <= 14 - return wmemchr(__s, __a, __n); + return _VSTD::wmemchr(__s, __a, __n); #else for (; __n; --__n) { @@ -611,7 +613,7 @@ { return __libcpp_is_constant_evaluated() ? _VSTD::__move_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : (char_type*)memmove(__s1, __s2, __n); + : __n == 0 ? __s1 : (char_type*)_VSTD::memmove(__s1, __s2, __n); } static _LIBCPP_CONSTEXPR_AFTER_CXX17 @@ -620,7 +622,7 @@ _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range"); return __libcpp_is_constant_evaluated() ? _VSTD::__copy_constexpr(__s1, __s2, __n) - : __n == 0 ? __s1 : (char_type*)memcpy(__s1, __s2, __n); + : __n == 0 ? __s1 : (char_type*)_VSTD::memcpy(__s1, __s2, __n); } static _LIBCPP_CONSTEXPR_AFTER_CXX17 @@ -628,7 +630,7 @@ { return __libcpp_is_constant_evaluated() ? _VSTD::__assign_constexpr(__s, __n, __a) - : __n == 0 ? __s : (char_type*)memset(__s, to_int_type(__a), __n); + : __n == 0 ? __s : (char_type*)_VSTD::memset(__s, to_int_type(__a), __n); } static inline constexpr int_type not_eof(int_type __c) noexcept diff --git a/libcxx/include/atomic b/libcxx/include/atomic --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -662,7 +662,7 @@ template _LIBCPP_INLINE_VISIBILITY bool __cxx_nonatomic_compare_equal(_Tp const& __lhs, _Tp const& __rhs) { - return memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0; + return _VSTD::memcmp(&__lhs, &__rhs, sizeof(_Tp)) == 0; } static_assert((is_same::type, __memory_order_underlying_t>::value), @@ -1262,7 +1262,7 @@ _Tp __temp; __a->__lock(); __cxx_atomic_assign_volatile(__temp, __a->__a_value); - bool __ret = (memcmp(&__temp, __expected, sizeof(_Tp)) == 0); + bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0); if(__ret) __cxx_atomic_assign_volatile(__a->__a_value, __value); else @@ -1275,11 +1275,11 @@ bool __cxx_atomic_compare_exchange_strong(__cxx_atomic_lock_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order, memory_order) { __a->__lock(); - bool __ret = (memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0); + bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0); if(__ret) - memcpy(&__a->__a_value, &__value, sizeof(_Tp)); + _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp)); else - memcpy(__expected, &__a->__a_value, sizeof(_Tp)); + _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp)); __a->__unlock(); return __ret; } @@ -1291,7 +1291,7 @@ _Tp __temp; __a->__lock(); __cxx_atomic_assign_volatile(__temp, __a->__a_value); - bool __ret = (memcmp(&__temp, __expected, sizeof(_Tp)) == 0); + bool __ret = (_VSTD::memcmp(&__temp, __expected, sizeof(_Tp)) == 0); if(__ret) __cxx_atomic_assign_volatile(__a->__a_value, __value); else @@ -1304,11 +1304,11 @@ bool __cxx_atomic_compare_exchange_weak(__cxx_atomic_lock_impl<_Tp>* __a, _Tp* __expected, _Tp __value, memory_order, memory_order) { __a->__lock(); - bool __ret = (memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0); + bool __ret = (_VSTD::memcmp(&__a->__a_value, __expected, sizeof(_Tp)) == 0); if(__ret) - memcpy(&__a->__a_value, &__value, sizeof(_Tp)); + _VSTD::memcpy(&__a->__a_value, &__value, sizeof(_Tp)); else - memcpy(__expected, &__a->__a_value, sizeof(_Tp)); + _VSTD::memcpy(__expected, &__a->__a_value, sizeof(_Tp)); __a->__unlock(); return __ret; } diff --git a/libcxx/include/fstream b/libcxx/include/fstream --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -721,7 +721,7 @@ int_type __c = traits_type::eof(); if (this->gptr() == this->egptr()) { - memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type)); + _VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type)); if (__always_noconv_) { size_t __nmemb = static_cast(this->egptr() - this->eback() - __unget_sz); @@ -738,7 +738,7 @@ { _LIBCPP_ASSERT ( !(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" ); if (__extbufend_ != __extbufnext_) - memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_); + _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_); __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_); __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_); size_t __nmemb = _VSTD::min(static_cast(__ibs_ - __unget_sz), diff --git a/libcxx/include/list b/libcxx/include/list --- a/libcxx/include/list +++ b/libcxx/include/list @@ -810,7 +810,7 @@ { __cn2->__add(*__p); if (--__cn1->end_ != __p) - memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__cn1->end_ - __p)*sizeof(__i_node*)); } else (*__p)->__c_ = __cn1; @@ -823,7 +823,7 @@ { __cn1->__add(*__p); if (--__cn2->end_ != __p) - memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*)); } else (*__p)->__c_ = __cn2; @@ -1758,7 +1758,7 @@ { (*__p)->__c_ = nullptr; if (--__c->end_ != __p) - memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); } } __get_db()->unlock(); @@ -1787,7 +1787,7 @@ { (*__p)->__c_ = nullptr; if (--__c->end_ != __p) - memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); } } __get_db()->unlock(); @@ -1823,7 +1823,7 @@ { (*__ip)->__c_ = nullptr; if (--__c->end_ != __ip) - memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*)); + _VSTD::memmove(__ip, __ip+1, (__c->end_ - __ip)*sizeof(__i_node*)); } } __get_db()->unlock(); @@ -1869,7 +1869,7 @@ { (*__p)->__c_ = nullptr; if (--__c->end_ != __p) - memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); } } __get_db()->unlock(); @@ -2034,7 +2034,7 @@ __cn1->__add(*__ip); (*__ip)->__c_ = __cn1; if (--__cn2->end_ != __ip) - memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); + _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); } } __db->unlock(); @@ -2079,7 +2079,7 @@ __cn1->__add(*__ip); (*__ip)->__c_ = __cn1; if (--__cn2->end_ != __ip) - memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); + _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); } } __db->unlock(); @@ -2138,7 +2138,7 @@ __cn1->__add(*__ip); (*__ip)->__c_ = __cn1; if (--__cn2->end_ != __ip) - memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); + _VSTD::memmove(__ip, __ip+1, (__cn2->end_ - __ip)*sizeof(__i_node*)); } } } @@ -2271,7 +2271,7 @@ __cn1->__add(*__p); (*__p)->__c_ = __cn1; if (--__cn2->end_ != __p) - memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__cn2->end_ - __p)*sizeof(__i_node*)); } } __db->unlock(); diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -3578,7 +3578,7 @@ char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str()); string_type __w; __widen_from_utf8()(back_inserter(__w), - __n, __n + strlen(__n)); + __n, __n + _VSTD::strlen(__n)); return __w; #else // !_LIBCPP_HAS_CATOPEN _LIBCPP_UNUSED_VAR(__c); @@ -3999,7 +3999,7 @@ int_type __c = traits_type::eof(); if (this->gptr() == this->egptr()) { - memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type)); + _VSTD::memmove(this->eback(), this->egptr() - __unget_sz, __unget_sz * sizeof(char_type)); if (__always_noconv_) { streamsize __nmemb = static_cast(this->egptr() - this->eback() - __unget_sz); @@ -4016,7 +4016,7 @@ { _LIBCPP_ASSERT(!(__extbufnext_ == NULL && (__extbufend_ != __extbufnext_)), "underflow moving from NULL" ); if (__extbufend_ != __extbufnext_) - memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_); + _VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_); __extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_); __extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_); streamsize __nmemb = _VSTD::min(static_cast(this->egptr() - this->eback() - __unget_sz), diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -1774,7 +1774,7 @@ { (*__p)->__c_ = nullptr; if (--__c->end_ != __p) - memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); } } __get_db()->unlock(); diff --git a/libcxx/include/strstream b/libcxx/include/strstream --- a/libcxx/include/strstream +++ b/libcxx/include/strstream @@ -290,7 +290,7 @@ _LIBCPP_INLINE_VISIBILITY ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out) : ostream(&__sb_), - __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0)) + __sb_(__s, __n, __s + (__mode & ios::app ? _VSTD::strlen(__s) : 0)) {} #ifndef _LIBCPP_CXX03_LANG @@ -350,7 +350,7 @@ _LIBCPP_INLINE_VISIBILITY strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out) : iostream(&__sb_), - __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0)) + __sb_(__s, __n, __s + (__mode & ios::app ? _VSTD::strlen(__s) : 0)) {} #ifndef _LIBCPP_CXX03_LANG diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -2139,7 +2139,7 @@ if (__i->base() > __new_last) { (*__p)->__c_ = nullptr; if (--__c->end_ != __p) - memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); + _VSTD::memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*)); } } __get_db()->unlock();