Index: libcxx/CMakeLists.txt =================================================================== --- libcxx/CMakeLists.txt +++ libcxx/CMakeLists.txt @@ -589,6 +589,10 @@ # library. target_compile_definitions(${target} PRIVATE -D_LIBCPP_BUILDING_LIBRARY) + if (LIBCXX_ENABLE_DEBUG_MODE_SUPPORT) + target_compile_definitions(${target} PRIVATE -D_LIBCPP_BUILDING_DEBUG_MODE_SUPPORT) + endif() + if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS) target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS) endif() Index: libcxx/include/string =================================================================== --- libcxx/include/string +++ libcxx/include/string @@ -4515,6 +4515,7 @@ _LIBCPP_FUNC_VIS double stod (const string& __str, size_t* __idx = nullptr); _LIBCPP_FUNC_VIS long double stold(const string& __str, size_t* __idx = nullptr); +#if _LIBCPP_DEBUG_LEVEL != 2 _LIBCPP_FUNC_VIS string to_string(int __val); _LIBCPP_FUNC_VIS string to_string(unsigned __val); _LIBCPP_FUNC_VIS string to_string(long __val); @@ -4524,6 +4525,84 @@ _LIBCPP_FUNC_VIS string to_string(float __val); _LIBCPP_FUNC_VIS string to_string(double __val); _LIBCPP_FUNC_VIS string to_string(long double __val); +#else +inline namespace debug +{ +_LIBCPP_FUNC_VIS string __to_string(int __val); +_LIBCPP_FUNC_VIS string __to_string(unsigned __val); +_LIBCPP_FUNC_VIS string __to_string(long __val); +_LIBCPP_FUNC_VIS string __to_string(unsigned long __val); +_LIBCPP_FUNC_VIS string __to_string(long long __val); +_LIBCPP_FUNC_VIS string __to_string(unsigned long long __val); +_LIBCPP_FUNC_VIS string __to_string(float __val); +_LIBCPP_FUNC_VIS string __to_string(double __val); +_LIBCPP_FUNC_VIS string __to_string(long double __val); + +inline _LIBCPP_HIDE_FROM_ABI string to_string(int __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI string to_string(unsigned __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI string to_string(long __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI string to_string(unsigned long __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI string to_string(long long __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI string to_string(unsigned long long __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI string to_string(float __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI string to_string(double __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI string to_string(long double __val) +{ + string __s = __to_string(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +} +#endif #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS _LIBCPP_FUNC_VIS int stoi (const wstring& __str, size_t* __idx = nullptr, int __base = 10); @@ -4536,6 +4615,7 @@ _LIBCPP_FUNC_VIS double stod (const wstring& __str, size_t* __idx = nullptr); _LIBCPP_FUNC_VIS long double stold(const wstring& __str, size_t* __idx = nullptr); +#if _LIBCPP_DEBUG_LEVEL != 2 _LIBCPP_FUNC_VIS wstring to_wstring(int __val); _LIBCPP_FUNC_VIS wstring to_wstring(unsigned __val); _LIBCPP_FUNC_VIS wstring to_wstring(long __val); @@ -4545,6 +4625,84 @@ _LIBCPP_FUNC_VIS wstring to_wstring(float __val); _LIBCPP_FUNC_VIS wstring to_wstring(double __val); _LIBCPP_FUNC_VIS wstring to_wstring(long double __val); +#else +inline namespace debug +{ +_LIBCPP_FUNC_VIS wstring __to_wstring(int __val); +_LIBCPP_FUNC_VIS wstring __to_wstring(unsigned __val); +_LIBCPP_FUNC_VIS wstring __to_wstring(long __val); +_LIBCPP_FUNC_VIS wstring __to_wstring(unsigned long __val); +_LIBCPP_FUNC_VIS wstring __to_wstring(long long __val); +_LIBCPP_FUNC_VIS wstring __to_wstring(unsigned long long __val); +_LIBCPP_FUNC_VIS wstring __to_wstring(float __val); +_LIBCPP_FUNC_VIS wstring __to_wstring(double __val); +_LIBCPP_FUNC_VIS wstring __to_wstring(long double __val); + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(int __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(unsigned __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(long __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(unsigned long __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(long long __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(unsigned long long __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(float __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(double __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +inline _LIBCPP_HIDE_FROM_ABI wstring to_wstring(long double __val) +{ + wstring __s = __to_wstring(__val); + std::__debug_db_insert_c(&__s); + return __s; +} + +} +#endif #endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS template Index: libcxx/lib/abi/CHANGELOG.TXT =================================================================== --- libcxx/lib/abi/CHANGELOG.TXT +++ libcxx/lib/abi/CHANGELOG.TXT @@ -16,6 +16,33 @@ Version 15.0 ------------ +* [libc++] fix std::to_string() crashing in debug mode + + This patch adds __to_string() and __to_wstring() helpers to an inline __debug + namespace, used by std::to_string() and std::to_wstring(), which are now inline + functions in debug mode. + + All platforms + ------------- + Symbol added: _ZNSt3__15debug11__to_stringEd + Symbol added: _ZNSt3__15debug11__to_stringEe + Symbol added: _ZNSt3__15debug11__to_stringEf + Symbol added: _ZNSt3__15debug11__to_stringEi + Symbol added: _ZNSt3__15debug11__to_stringEj + Symbol added: _ZNSt3__15debug11__to_stringEl + Symbol added: _ZNSt3__15debug11__to_stringEm + Symbol added: _ZNSt3__15debug11__to_stringEx + Symbol added: _ZNSt3__15debug11__to_stringEy + Symbol added: _ZNSt3__15debug12__to_wstringEd + Symbol added: _ZNSt3__15debug12__to_wstringEe + Symbol added: _ZNSt3__15debug12__to_wstringEf + Symbol added: _ZNSt3__15debug12__to_wstringEi + Symbol added: _ZNSt3__15debug12__to_wstringEj + Symbol added: _ZNSt3__15debug12__to_wstringEl + Symbol added: _ZNSt3__15debug12__to_wstringEm + Symbol added: _ZNSt3__15debug12__to_wstringEx + Symbol added: _ZNSt3__15debug12__to_wstringEy + * b0fd9497af6d - [libc++] Add a lightweight overridable assertion handler This patch adds a lightweight assertion handler mechanism that can be Index: libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist =================================================================== --- libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist +++ libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist @@ -1659,6 +1659,24 @@ {'is_defined': True, 'name': '__ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEy', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEy', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15mutex4lockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15mutex6unlockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'} Index: libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist =================================================================== --- libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist +++ libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist @@ -1659,6 +1659,24 @@ {'is_defined': True, 'name': '__ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug11__to_stringEy', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15debug12__to_wstringEy', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15mutex4lockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15mutex6unlockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'} Index: libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist =================================================================== --- libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist +++ libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.debug.incomplete.abilist @@ -1352,6 +1352,24 @@ {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEy', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEy', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex4lockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex6unlockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'} Index: libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.debug.noincomplete.abilist =================================================================== --- libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.debug.noincomplete.abilist +++ libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.debug.noincomplete.abilist @@ -1349,6 +1349,24 @@ {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEy', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEy', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex4lockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex6unlockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'} Index: libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.debug.incomplete.abilist =================================================================== --- libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.debug.incomplete.abilist +++ libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.debug.incomplete.abilist @@ -1324,6 +1324,24 @@ {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED0Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED1Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIwED2Ev', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug11__to_stringEy', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEd', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEe', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEf', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEi', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEj', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEl', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEx', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15debug12__to_wstringEy', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex4lockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex6unlockEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15mutex8try_lockEv', 'type': 'FUNC'} Index: libcxx/src/string.cpp =================================================================== --- libcxx/src/string.cpp +++ libcxx/src/string.cpp @@ -511,4 +511,35 @@ wstring to_wstring(long double val) { return as_string(get_swprintf(), initial_string()(), L"%Lf", val); } #endif +#ifdef _LIBCPP_BUILDING_DEBUG_MODE_SUPPORT +inline namespace debug +{ +_LIBCPP_FUNC_VIS string __to_string (int val) { return i_to_string< string>(val); } +_LIBCPP_FUNC_VIS string __to_string (long val) { return i_to_string< string>(val); } +_LIBCPP_FUNC_VIS string __to_string (long long val) { return i_to_string< string>(val); } +_LIBCPP_FUNC_VIS string __to_string (unsigned val) { return i_to_string< string>(val); } +_LIBCPP_FUNC_VIS string __to_string (unsigned long val) { return i_to_string< string>(val); } +_LIBCPP_FUNC_VIS string __to_string (unsigned long long val) { return i_to_string< string>(val); } + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +_LIBCPP_FUNC_VIS wstring __to_wstring(int val) { return i_to_string(val); } +_LIBCPP_FUNC_VIS wstring __to_wstring(long val) { return i_to_string(val); } +_LIBCPP_FUNC_VIS wstring __to_wstring(long long val) { return i_to_string(val); } +_LIBCPP_FUNC_VIS wstring __to_wstring(unsigned val) { return i_to_string(val); } +_LIBCPP_FUNC_VIS wstring __to_wstring(unsigned long val) { return i_to_string(val); } +_LIBCPP_FUNC_VIS wstring __to_wstring(unsigned long long val) { return i_to_string(val); } +#endif + +_LIBCPP_FUNC_VIS string __to_string (float val) { return as_string(snprintf, initial_string< string>()(), "%f", val); } +_LIBCPP_FUNC_VIS string __to_string (double val) { return as_string(snprintf, initial_string< string>()(), "%f", val); } +_LIBCPP_FUNC_VIS string __to_string (long double val) { return as_string(snprintf, initial_string< string>()(), "%Lf", val); } + +#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +_LIBCPP_FUNC_VIS wstring __to_wstring(float val) { return as_string(get_swprintf(), initial_string()(), L"%f", val); } +_LIBCPP_FUNC_VIS wstring __to_wstring(double val) { return as_string(get_swprintf(), initial_string()(), L"%f", val); } +_LIBCPP_FUNC_VIS wstring __to_wstring(long double val) { return as_string(get_swprintf(), initial_string()(), L"%Lf", val); } +#endif +} +#endif + _LIBCPP_END_NAMESPACE_STD