diff options
author | dim <dim@FreeBSD.org> | 2014-03-05 19:30:36 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-03-05 19:30:36 +0000 |
commit | 22ca1336dcfb663d86a6892dbe1e48eee20bb6db (patch) | |
tree | 72f4bceef54682e8e577b4ddd08c0ad24ea08ff6 /contrib/libc++/src/string.cpp | |
parent | a5552de0b34d11a40bdc1d8e53fa44a923b6b1a8 (diff) | |
download | FreeBSD-src-22ca1336dcfb663d86a6892dbe1e48eee20bb6db.zip FreeBSD-src-22ca1336dcfb663d86a6892dbe1e48eee20bb6db.tar.gz |
MFC r261283:
Import libc++ 3.4 release. This contains a lot of bugfixes, and some
preliminary support for C++1y.
MFC r261604:
HEAD is not buildable for the past day. Commit a 'quick fix' in order to permit
buildworld to complete.
Reviewed by: theraven
MFC r261608:
Apply a cleaner solution for the sign warnings that can occur when
compiling libc++'s <locale> header with -Wsystem-headers on.
This has also been submitted upstream.
Reported by: asomers
MFC r261801:
An ABI incompatibility crept into the libc++ 3.4 import in r261283. It
was caused by upstream libc++ commit r194536, which aimed to make the
headers more standards-compliant, by making std::pair's copy constructor
trivial. Unfortunately, this could cause certain C++ applications using
shared libraries built against the previous version of libc++ to crash.
Fix the ABI incompatibility by making std::pair's copy constructor
non-trivial again.
Please note: Any C++ applications or shared libraries built with libc++
between r261283 and this revision should be recompiled.
Reported by: stefanf
Diffstat (limited to 'contrib/libc++/src/string.cpp')
-rw-r--r-- | contrib/libc++/src/string.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/libc++/src/string.cpp b/contrib/libc++/src/string.cpp index c6fe408..fde5212 100644 --- a/contrib/libc++/src/string.cpp +++ b/contrib/libc++/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 <stdio.h> _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<long>( func, s, idx, base, strtol ); if (r < numeric_limits<int>::min() || numeric_limits<int>::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<int (__cdecl*)(wchar_t* __restrict, size_t, const wchar_t*__restrict, ...)>(swprintf); |