From a5b2dbc259e289ea23fe9aebb34eba2c1dc7fefb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 29 Jan 2014 19:30:27 +0000 Subject: Vendor import of libc++ tags/RELEASE_34/final r197960: https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_34/final@197960 --- src/string.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/string.cpp') diff --git a/src/string.cpp b/src/string.cpp index c6fe408ca1ca..fde52129e9fb 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -7,15 +7,18 @@ // //===----------------------------------------------------------------------===// +#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__; + #include "string" #include "cstdlib" #include "cwchar" #include "cerrno" #include "limits" #include "stdexcept" -#ifdef _WIN32 +#ifdef _LIBCPP_MSVCRT #include "support/win32/support.h" -#endif // _WIN32 +#endif // _LIBCPP_MSVCRT +#include _LIBCPP_BEGIN_NAMESPACE_STD @@ -38,6 +41,7 @@ void throw_helper( const string& msg ) #ifndef _LIBCPP_NO_EXCEPTIONS throw T( msg ); #else + printf("%s\n", msg.c_str()); abort(); #endif } @@ -87,7 +91,7 @@ inline int as_integer(const string& func, const string& s, size_t* idx, int base ) { - // Use long as no Stantard string to integer exists. + // Use long as no Standard string to integer exists. long r = as_integer_helper( func, s, idx, base, strtol ); if (r < numeric_limits::min() || numeric_limits::max() < r) throw_from_string_out_of_range(func); @@ -425,7 +429,7 @@ inline wide_printf get_swprintf() { -#ifndef _WIN32 +#ifndef _LIBCPP_MSVCRT return swprintf; #else return static_cast(swprintf); -- cgit v1.3