Fixing whitespace problems

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@111751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant 2010-08-22 00:03:27 +00:00
parent 324bb03bb9
commit 16e6e1d72f
16 changed files with 131 additions and 158 deletions

@ -27,5 +27,4 @@ __ph<10> _10;
} // placeholders } // placeholders
_LIBCPP_END_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD

@ -15,7 +15,7 @@
#include <cerrno> // errno #include <cerrno> // errno
#include <system_error> // __throw_system_error #include <system_error> // __throw_system_error
#include <time.h> // clock_gettime, CLOCK_MONOTONIC #include <time.h> // clock_gettime, CLOCK_MONOTONIC
#endif /* __APPLE__ */ #endif // __APPLE__
_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_NAMESPACE_STD
@ -103,7 +103,7 @@ monotonic_clock::now()
return time_point(duration(fp())); return time_point(duration(fp()));
} }
#else /* !APPLE */ #else // __APPLE__
// FIXME: We assume that clock_gettime(CLOCK_MONOTONIC) works on // FIXME: We assume that clock_gettime(CLOCK_MONOTONIC) works on
// non-apple systems. Instead, we should check _POSIX_TIMERS and // non-apple systems. Instead, we should check _POSIX_TIMERS and
// _POSIX_MONOTONIC_CLOCK and fall back to something else if those // _POSIX_MONOTONIC_CLOCK and fall back to something else if those
@ -121,7 +121,7 @@ monotonic_clock::now()
__throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed"); __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed");
return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec)); return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
} }
#endif /* APPLE */ #endif // __APPLE__
} }

@ -18,14 +18,12 @@
// current unexpected handler are in the ABI library. // current unexpected handler are in the ABI library.
#define __terminate_handler __cxxabiapple::__cxa_terminate_handler #define __terminate_handler __cxxabiapple::__cxa_terminate_handler
#define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler #define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler
#else #else // __APPLE__
static std::terminate_handler __terminate_handler; static std::terminate_handler __terminate_handler;
static std::unexpected_handler __unexpected_handler; static std::unexpected_handler __unexpected_handler;
#endif #endif // __APPLE__
std::unexpected_handler
std::unexpected_handler
std::set_unexpected(std::unexpected_handler func) throw() std::set_unexpected(std::unexpected_handler func) throw()
{ {
std::terminate_handler old = __unexpected_handler; std::terminate_handler old = __unexpected_handler;
@ -41,8 +39,7 @@ std::unexpected()
std::terminate(); std::terminate();
} }
std::terminate_handler
std::terminate_handler
std::set_terminate(std::terminate_handler func) throw() std::set_terminate(std::terminate_handler func) throw()
{ {
std::terminate_handler old = __terminate_handler; std::terminate_handler old = __terminate_handler;
@ -50,53 +47,49 @@ std::set_terminate(std::terminate_handler func) throw()
return old; return old;
} }
void void
std::terminate() std::terminate()
{ {
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
try try
{ {
#endif #endif // _LIBCPP_NO_EXCEPTIONS
(*__terminate_handler)(); (*__terminate_handler)();
// handler should not return // handler should not return
::abort (); ::abort ();
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
} }
catch (...) catch (...)
{ {
// handler should not throw exception // handler should not throw exception
::abort (); ::abort ();
} }
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
bool std::uncaught_exception() throw() bool std::uncaught_exception() throw()
{ {
#if __APPLE__ #if __APPLE__
// on Darwin, there is a helper function so __cxa_get_globals is private // on Darwin, there is a helper function so __cxa_get_globals is private
return __cxxabiapple::__cxa_uncaught_exception(); return __cxxabiapple::__cxa_uncaught_exception();
#else #else // __APPLE__
#warning uncaught_exception not yet implemented #warning uncaught_exception not yet implemented
::abort(); ::abort();
// Not provided by Ubuntu gcc-4.2.4's cxxabi.h. // Not provided by Ubuntu gcc-4.2.4's cxxabi.h.
// __cxa_eh_globals * globals = __cxa_get_globals(); // __cxa_eh_globals * globals = __cxa_get_globals();
// return (globals->uncaughtExceptions != 0); // return (globals->uncaughtExceptions != 0);
#endif #endif // __APPLE__
} }
namespace std
namespace std
{ {
exception::~exception() throw()
exception::~exception() throw() {
{
} }
bad_exception::~bad_exception() throw() bad_exception::~bad_exception() throw()
{ {
} }
const char* exception::what() const throw() const char* exception::what() const throw()
@ -109,8 +102,6 @@ const char* bad_exception::what() const throw()
return "std::bad_exception"; return "std::bad_exception";
} }
exception_ptr::~exception_ptr() exception_ptr::~exception_ptr()
{ {
#if __APPLE__ #if __APPLE__
@ -118,7 +109,7 @@ exception_ptr::~exception_ptr()
#else #else
#warning exception_ptr not yet implemented #warning exception_ptr not yet implemented
::abort(); ::abort();
#endif #endif // __APPLE__
} }
exception_ptr::exception_ptr(const exception_ptr& other) exception_ptr::exception_ptr(const exception_ptr& other)
@ -129,7 +120,7 @@ exception_ptr::exception_ptr(const exception_ptr& other)
#else #else
#warning exception_ptr not yet implemented #warning exception_ptr not yet implemented
::abort(); ::abort();
#endif #endif // __APPLE__
} }
exception_ptr& exception_ptr::operator=(const exception_ptr& other) exception_ptr& exception_ptr::operator=(const exception_ptr& other)
@ -142,10 +133,10 @@ exception_ptr& exception_ptr::operator=(const exception_ptr& other)
__ptr_ = other.__ptr_; __ptr_ = other.__ptr_;
} }
return *this; return *this;
#else #else // __APPLE__
#warning exception_ptr not yet implemented #warning exception_ptr not yet implemented
::abort(); ::abort();
#endif #endif // __APPLE__
} }
nested_exception::nested_exception() nested_exception::nested_exception()
@ -167,30 +158,29 @@ nested_exception::rethrow_nested /*[[noreturn]]*/ () const
} // std } // std
std::exception_ptr std::current_exception() std::exception_ptr std::current_exception()
{ {
#if __APPLE__ #if __APPLE__
// be nicer if there was a constructor that took a ptr, then // be nicer if there was a constructor that took a ptr, then
// this whole function would be just: // this whole function would be just:
// return exception_ptr(__cxa_current_primary_exception()); // return exception_ptr(__cxa_current_primary_exception());
std::exception_ptr ptr; std::exception_ptr ptr;
ptr.__ptr_ = __cxxabiapple::__cxa_current_primary_exception(); ptr.__ptr_ = __cxxabiapple::__cxa_current_primary_exception();
return ptr; return ptr;
#else #else // __APPLE__
#warning exception_ptr not yet implemented #warning exception_ptr not yet implemented
::abort(); ::abort();
#endif #endif // __APPLE__
} }
void std::rethrow_exception(exception_ptr p) void std::rethrow_exception(exception_ptr p)
{ {
#if __APPLE__ #if __APPLE__
__cxxabiapple::__cxa_rethrow_primary_exception(p.__ptr_); __cxxabiapple::__cxa_rethrow_primary_exception(p.__ptr_);
// if p.__ptr_ is NULL, above returns so we terminate // if p.__ptr_ is NULL, above returns so we terminate
terminate(); terminate();
#else #else // __APPLE__
#warning exception_ptr not yet implemented #warning exception_ptr not yet implemented
::abort(); ::abort();
#endif #endif // __APPLE__
} }

@ -126,14 +126,14 @@ const unsigned indices[] =
// Returns: If n == 0, returns 0. Else returns the lowest prime number that // Returns: If n == 0, returns 0. Else returns the lowest prime number that
// is greater than or equal to n. // is greater than or equal to n.
// //
// The algorithm creates a list of small primes, plus an open-ended list of // The algorithm creates a list of small primes, plus an open-ended list of
// potential primes. All prime numbers are potential prime numbers. However // potential primes. All prime numbers are potential prime numbers. However
// some potential prime numbers are not prime. In an ideal world, all potential // some potential prime numbers are not prime. In an ideal world, all potential
// prime numbers would be prime. Candiate prime numbers are chosen as the next // prime numbers would be prime. Candiate prime numbers are chosen as the next
// highest potential prime. Then this number is tested for prime by dividing it // highest potential prime. Then this number is tested for prime by dividing it
// by all potential prime numbers less than the sqrt of the candidate. // by all potential prime numbers less than the sqrt of the candidate.
// //
// This implementation defines potential primes as those numbers not divisible // This implementation defines potential primes as those numbers not divisible
// by 2, 3, 5, and 7. Other (common) implementations define potential primes // by 2, 3, 5, and 7. Other (common) implementations define potential primes
// as those not divisible by 2. A few other implementations define potential // as those not divisible by 2. A few other implementations define potential

@ -263,7 +263,7 @@ ios_base::clear(iostate state)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (((state | (__rdbuf_ ? goodbit : badbit)) & __exceptions_) != 0) if (((state | (__rdbuf_ ? goodbit : badbit)) & __exceptions_) != 0)
throw failure("ios_base::clear"); throw failure("ios_base::clear");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
// init // init
@ -305,12 +305,12 @@ ios_base::copyfmt(const ios_base& rhs)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (!new_callbacks) if (!new_callbacks)
throw bad_alloc(); throw bad_alloc();
#endif #endif // _LIBCPP_NO_EXCEPTIONS
new_ints.reset((int*)malloc(sizeof(int) * rhs.__event_size_)); new_ints.reset((int*)malloc(sizeof(int) * rhs.__event_size_));
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (!new_ints) if (!new_ints)
throw bad_alloc(); throw bad_alloc();
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (__iarray_cap_ < rhs.__iarray_size_) if (__iarray_cap_ < rhs.__iarray_size_)
{ {
@ -318,7 +318,7 @@ ios_base::copyfmt(const ios_base& rhs)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (!new_longs) if (!new_longs)
throw bad_alloc(); throw bad_alloc();
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (__parray_cap_ < rhs.__parray_size_) if (__parray_cap_ < rhs.__parray_size_)
{ {
@ -326,7 +326,7 @@ ios_base::copyfmt(const ios_base& rhs)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (!new_pointers) if (!new_pointers)
throw bad_alloc(); throw bad_alloc();
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
// Got everything we need. Copy everything but __rdstate_, __rdbuf_ and __exceptions_ // Got everything we need. Copy everything but __rdstate_, __rdbuf_ and __exceptions_
__fmtflags_ = rhs.__fmtflags_; __fmtflags_ = rhs.__fmtflags_;
@ -430,7 +430,7 @@ ios_base::__set_badbit_and_consider_rethrow()
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (__exceptions_ & badbit) if (__exceptions_ & badbit)
throw; throw;
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
void void
@ -440,7 +440,7 @@ ios_base::__set_failbit_and_consider_rethrow()
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (__exceptions_ & failbit) if (__exceptions_ & failbit)
throw; throw;
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
bool bool

@ -135,7 +135,7 @@ locale::__imp::__imp(const string& name, size_t refs)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
try try
{ {
#endif #endif // _LIBCPP_NO_EXCEPTIONS
facets_ = locale::classic().__locale_->facets_; facets_ = locale::classic().__locale_->facets_;
for (unsigned i = 0; i < facets_.size(); ++i) for (unsigned i = 0; i < facets_.size(); ++i)
if (facets_[i]) if (facets_[i])
@ -169,7 +169,7 @@ locale::__imp::__imp(const string& name, size_t refs)
facets_[i]->__release_shared(); facets_[i]->__release_shared();
throw; throw;
} }
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
locale::__imp::__imp(const __imp& other) locale::__imp::__imp(const __imp& other)
@ -193,7 +193,7 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
try try
{ {
#endif #endif // _LIBCPP_NO_EXCEPTIONS
if (c & locale::collate) if (c & locale::collate)
{ {
install(new collate_byname<char>(name)); install(new collate_byname<char>(name));
@ -241,7 +241,7 @@ locale::__imp::__imp(const __imp& other, const string& name, locale::category c)
facets_[i]->__release_shared(); facets_[i]->__release_shared();
throw; throw;
} }
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
template<class F> template<class F>
@ -264,7 +264,7 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
try try
{ {
#endif #endif // _LIBCPP_NO_EXCEPTIONS
if (c & locale::collate) if (c & locale::collate)
{ {
install_from<_STD::collate<char> >(one); install_from<_STD::collate<char> >(one);
@ -320,7 +320,7 @@ locale::__imp::__imp(const __imp& other, const __imp& one, locale::category c)
facets_[i]->__release_shared(); facets_[i]->__release_shared();
throw; throw;
} }
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
locale::__imp::__imp(const __imp& other, facet* f, long id) locale::__imp::__imp(const __imp& other, facet* f, long id)
@ -361,7 +361,7 @@ locale::__imp::use_facet(long id) const
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (!has_facet(id)) if (!has_facet(id))
throw bad_cast(); throw bad_cast();
#endif #endif // _LIBCPP_NO_EXCEPTIONS
return facets_[id]; return facets_[id];
} }
@ -431,7 +431,7 @@ locale::locale(const char* name)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
: __locale_(name ? new __imp(name) : __locale_(name ? new __imp(name)
: throw runtime_error("locale constructed with null")) : throw runtime_error("locale constructed with null"))
#else #else // _LIBCPP_NO_EXCEPTIONS
: __locale_(new __imp(name)) : __locale_(new __imp(name))
#endif #endif
{ {
@ -448,7 +448,7 @@ locale::locale(const locale& other, const char* name, category c)
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
: __locale_(name ? new __imp(*other.__locale_, name, c) : __locale_(name ? new __imp(*other.__locale_, name, c)
: throw runtime_error("locale constructed with null")) : throw runtime_error("locale constructed with null"))
#else #else // _LIBCPP_NO_EXCEPTIONS
: __locale_(new __imp(*other.__locale_, name, c)) : __locale_(new __imp(*other.__locale_, name, c))
#endif #endif
{ {
@ -571,7 +571,7 @@ collate_byname<char>::collate_byname(const char* n, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("collate_byname<char>::collate_byname" throw runtime_error("collate_byname<char>::collate_byname"
" failed to construct for " + string(n)); " failed to construct for " + string(n));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
collate_byname<char>::collate_byname(const string& name, size_t refs) collate_byname<char>::collate_byname(const string& name, size_t refs)
@ -582,7 +582,7 @@ collate_byname<char>::collate_byname(const string& name, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("collate_byname<char>::collate_byname" throw runtime_error("collate_byname<char>::collate_byname"
" failed to construct for " + name); " failed to construct for " + name);
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
collate_byname<char>::~collate_byname() collate_byname<char>::~collate_byname()
@ -623,7 +623,7 @@ collate_byname<wchar_t>::collate_byname(const char* n, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)" throw runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
" failed to construct for " + string(n)); " failed to construct for " + string(n));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
collate_byname<wchar_t>::collate_byname(const string& name, size_t refs) collate_byname<wchar_t>::collate_byname(const string& name, size_t refs)
@ -634,7 +634,7 @@ collate_byname<wchar_t>::collate_byname(const string& name, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)" throw runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
" failed to construct for " + name); " failed to construct for " + name);
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
collate_byname<wchar_t>::~collate_byname() collate_byname<wchar_t>::~collate_byname()
@ -862,7 +862,7 @@ ctype_byname<char>::ctype_byname(const char* name, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("ctype_byname<char>::ctype_byname" throw runtime_error("ctype_byname<char>::ctype_byname"
" failed to construct for " + string(name)); " failed to construct for " + string(name));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
ctype_byname<char>::ctype_byname(const string& name, size_t refs) ctype_byname<char>::ctype_byname(const string& name, size_t refs)
@ -873,7 +873,7 @@ ctype_byname<char>::ctype_byname(const string& name, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("ctype_byname<char>::ctype_byname" throw runtime_error("ctype_byname<char>::ctype_byname"
" failed to construct for " + name); " failed to construct for " + name);
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
ctype_byname<char>::~ctype_byname() ctype_byname<char>::~ctype_byname()
@ -919,7 +919,7 @@ ctype_byname<wchar_t>::ctype_byname(const char* name, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("ctype_byname<wchar_t>::ctype_byname" throw runtime_error("ctype_byname<wchar_t>::ctype_byname"
" failed to construct for " + string(name)); " failed to construct for " + string(name));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
ctype_byname<wchar_t>::ctype_byname(const string& name, size_t refs) ctype_byname<wchar_t>::ctype_byname(const string& name, size_t refs)
@ -930,7 +930,7 @@ ctype_byname<wchar_t>::ctype_byname(const string& name, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("ctype_byname<wchar_t>::ctype_byname" throw runtime_error("ctype_byname<wchar_t>::ctype_byname"
" failed to construct for " + name); " failed to construct for " + name);
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
ctype_byname<wchar_t>::~ctype_byname() ctype_byname<wchar_t>::~ctype_byname()
@ -1057,15 +1057,15 @@ ctype_byname<wchar_t>::do_narrow(const char_type* low, const char_type* high, ch
// template <> class codecvt<char, char, mbstate_t> // template <> class codecvt<char, char, mbstate_t>
locale::id codecvt<char, char, mbstate_t>::id; locale::id codecvt<char, char, mbstate_t>::id;
codecvt<char, char, mbstate_t>::~codecvt() codecvt<char, char, mbstate_t>::~codecvt()
{ {
} }
codecvt<char, char, mbstate_t>::result codecvt<char, char, mbstate_t>::result
codecvt<char, char, mbstate_t>::do_out(state_type&, codecvt<char, char, mbstate_t>::do_out(state_type&,
const intern_type* frm, const intern_type*, const intern_type*& frm_nxt, const intern_type* frm, const intern_type*, const intern_type*& frm_nxt,
extern_type* to, extern_type*, extern_type*& to_nxt) const extern_type* to, extern_type*, extern_type*& to_nxt) const
{ {
frm_nxt = frm; frm_nxt = frm;
@ -1074,8 +1074,8 @@ codecvt<char, char, mbstate_t>::do_out(state_type&,
} }
codecvt<char, char, mbstate_t>::result codecvt<char, char, mbstate_t>::result
codecvt<char, char, mbstate_t>::do_in(state_type&, codecvt<char, char, mbstate_t>::do_in(state_type&,
const extern_type* frm, const extern_type*, const extern_type*& frm_nxt, const extern_type* frm, const extern_type*, const extern_type*& frm_nxt,
intern_type* to, intern_type*, intern_type*& to_nxt) const intern_type* to, intern_type*, intern_type*& to_nxt) const
{ {
frm_nxt = frm; frm_nxt = frm;
@ -1084,7 +1084,7 @@ codecvt<char, char, mbstate_t>::do_in(state_type&,
} }
codecvt<char, char, mbstate_t>::result codecvt<char, char, mbstate_t>::result
codecvt<char, char, mbstate_t>::do_unshift(state_type&, codecvt<char, char, mbstate_t>::do_unshift(state_type&,
extern_type* to, extern_type*, extern_type*& to_nxt) const extern_type* to, extern_type*, extern_type*& to_nxt) const
{ {
to_nxt = to; to_nxt = to;
@ -1118,7 +1118,7 @@ codecvt<char, char, mbstate_t>::do_max_length() const throw()
// template <> class codecvt<wchar_t, char, mbstate_t> // template <> class codecvt<wchar_t, char, mbstate_t>
locale::id codecvt<wchar_t, char, mbstate_t>::id; locale::id codecvt<wchar_t, char, mbstate_t>::id;
codecvt<wchar_t, char, mbstate_t>::codecvt(size_t refs) codecvt<wchar_t, char, mbstate_t>::codecvt(size_t refs)
: locale::facet(refs), : locale::facet(refs),
@ -1134,7 +1134,7 @@ codecvt<wchar_t, char, mbstate_t>::codecvt(const char* nm, size_t refs)
if (__l == 0) if (__l == 0)
throw runtime_error("codecvt_byname<wchar_t, char, mbstate_t>::codecvt_byname" throw runtime_error("codecvt_byname<wchar_t, char, mbstate_t>::codecvt_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
codecvt<wchar_t, char, mbstate_t>::~codecvt() codecvt<wchar_t, char, mbstate_t>::~codecvt()
@ -1145,7 +1145,7 @@ codecvt<wchar_t, char, mbstate_t>::~codecvt()
codecvt<wchar_t, char, mbstate_t>::result codecvt<wchar_t, char, mbstate_t>::result
codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st, codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt, const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
extern_type* to, extern_type* to_end, extern_type*& to_nxt) const extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
{ {
// look for first internal null in frm // look for first internal null in frm
@ -1201,7 +1201,7 @@ codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
codecvt<wchar_t, char, mbstate_t>::result codecvt<wchar_t, char, mbstate_t>::result
codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st, codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st,
const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt, const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt,
intern_type* to, intern_type* to_end, intern_type*& to_nxt) const intern_type* to, intern_type* to_end, intern_type*& to_nxt) const
{ {
// look for first internal null in frm // look for first internal null in frm
@ -2730,7 +2730,7 @@ utf16le_to_ucs2_length(const uint8_t* frm, const uint8_t* frm_end,
// template <> class codecvt<char16_t, char, mbstate_t> // template <> class codecvt<char16_t, char, mbstate_t>
locale::id codecvt<char16_t, char, mbstate_t>::id; locale::id codecvt<char16_t, char, mbstate_t>::id;
codecvt<char16_t, char, mbstate_t>::~codecvt() codecvt<char16_t, char, mbstate_t>::~codecvt()
{ {
@ -2738,7 +2738,7 @@ codecvt<char16_t, char, mbstate_t>::~codecvt()
codecvt<char16_t, char, mbstate_t>::result codecvt<char16_t, char, mbstate_t>::result
codecvt<char16_t, char, mbstate_t>::do_out(state_type&, codecvt<char16_t, char, mbstate_t>::do_out(state_type&,
const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt, const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
extern_type* to, extern_type* to_end, extern_type*& to_nxt) const extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
{ {
const uint16_t* _frm = reinterpret_cast<const uint16_t*>(frm); const uint16_t* _frm = reinterpret_cast<const uint16_t*>(frm);
@ -2755,7 +2755,7 @@ codecvt<char16_t, char, mbstate_t>::do_out(state_type&,
codecvt<char16_t, char, mbstate_t>::result codecvt<char16_t, char, mbstate_t>::result
codecvt<char16_t, char, mbstate_t>::do_in(state_type&, codecvt<char16_t, char, mbstate_t>::do_in(state_type&,
const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt, const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt,
intern_type* to, intern_type* to_end, intern_type*& to_nxt) const intern_type* to, intern_type* to_end, intern_type*& to_nxt) const
{ {
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm); const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
@ -2807,7 +2807,7 @@ codecvt<char16_t, char, mbstate_t>::do_max_length() const throw()
// template <> class codecvt<char32_t, char, mbstate_t> // template <> class codecvt<char32_t, char, mbstate_t>
locale::id codecvt<char32_t, char, mbstate_t>::id; locale::id codecvt<char32_t, char, mbstate_t>::id;
codecvt<char32_t, char, mbstate_t>::~codecvt() codecvt<char32_t, char, mbstate_t>::~codecvt()
{ {
@ -2815,7 +2815,7 @@ codecvt<char32_t, char, mbstate_t>::~codecvt()
codecvt<char32_t, char, mbstate_t>::result codecvt<char32_t, char, mbstate_t>::result
codecvt<char32_t, char, mbstate_t>::do_out(state_type&, codecvt<char32_t, char, mbstate_t>::do_out(state_type&,
const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt, const intern_type* frm, const intern_type* frm_end, const intern_type*& frm_nxt,
extern_type* to, extern_type* to_end, extern_type*& to_nxt) const extern_type* to, extern_type* to_end, extern_type*& to_nxt) const
{ {
const uint32_t* _frm = reinterpret_cast<const uint32_t*>(frm); const uint32_t* _frm = reinterpret_cast<const uint32_t*>(frm);
@ -2832,7 +2832,7 @@ codecvt<char32_t, char, mbstate_t>::do_out(state_type&,
codecvt<char32_t, char, mbstate_t>::result codecvt<char32_t, char, mbstate_t>::result
codecvt<char32_t, char, mbstate_t>::do_in(state_type&, codecvt<char32_t, char, mbstate_t>::do_in(state_type&,
const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt, const extern_type* frm, const extern_type* frm_end, const extern_type*& frm_nxt,
intern_type* to, intern_type* to_end, intern_type*& to_nxt) const intern_type* to, intern_type* to_end, intern_type*& to_nxt) const
{ {
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm); const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
@ -3876,7 +3876,7 @@ numpunct_byname<char>::__init(const char* nm)
if (loc == 0) if (loc == 0)
throw runtime_error("numpunct_byname<char>::numpunct_byname" throw runtime_error("numpunct_byname<char>::numpunct_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
lconv* lc = localeconv_l(loc.get()); lconv* lc = localeconv_l(loc.get());
if (*lc->decimal_point) if (*lc->decimal_point)
__decimal_point_ = *lc->decimal_point; __decimal_point_ = *lc->decimal_point;
@ -3915,7 +3915,7 @@ numpunct_byname<wchar_t>::__init(const char* nm)
if (loc == 0) if (loc == 0)
throw runtime_error("numpunct_byname<char>::numpunct_byname" throw runtime_error("numpunct_byname<char>::numpunct_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
lconv* lc = localeconv_l(loc.get()); lconv* lc = localeconv_l(loc.get());
if (*lc->decimal_point) if (*lc->decimal_point)
__decimal_point_ = *lc->decimal_point; __decimal_point_ = *lc->decimal_point;
@ -4322,7 +4322,7 @@ __time_get::__time_get(const char* nm)
if (__loc_ == 0) if (__loc_ == 0)
throw runtime_error("time_get_byname" throw runtime_error("time_get_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
__time_get::__time_get(const string& nm) __time_get::__time_get(const string& nm)
@ -4332,7 +4332,7 @@ __time_get::__time_get(const string& nm)
if (__loc_ == 0) if (__loc_ == 0)
throw runtime_error("time_get_byname" throw runtime_error("time_get_byname"
" failed to construct for " + nm); " failed to construct for " + nm);
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
__time_get::~__time_get() __time_get::~__time_get()
@ -4973,7 +4973,7 @@ __time_put::__time_put(const char* nm)
if (__loc_ == 0) if (__loc_ == 0)
throw runtime_error("time_put_byname" throw runtime_error("time_put_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
__time_put::__time_put(const string& nm) __time_put::__time_put(const string& nm)
@ -4983,7 +4983,7 @@ __time_put::__time_put(const string& nm)
if (__loc_ == 0) if (__loc_ == 0)
throw runtime_error("time_put_byname" throw runtime_error("time_put_byname"
" failed to construct for " + nm); " failed to construct for " + nm);
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
__time_put::~__time_put() __time_put::~__time_put()
@ -5266,7 +5266,7 @@ moneypunct_byname<char, false>::init(const char* nm)
if (loc == 0) if (loc == 0)
throw runtime_error("moneypunct_byname" throw runtime_error("moneypunct_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
lconv* lc = localeconv_l(loc.get()); lconv* lc = localeconv_l(loc.get());
if (*lc->mon_decimal_point) if (*lc->mon_decimal_point)
__decimal_point_ = *lc->mon_decimal_point; __decimal_point_ = *lc->mon_decimal_point;
@ -5304,7 +5304,7 @@ moneypunct_byname<char, true>::init(const char* nm)
if (loc == 0) if (loc == 0)
throw runtime_error("moneypunct_byname" throw runtime_error("moneypunct_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
lconv* lc = localeconv_l(loc.get()); lconv* lc = localeconv_l(loc.get());
if (*lc->mon_decimal_point) if (*lc->mon_decimal_point)
__decimal_point_ = *lc->mon_decimal_point; __decimal_point_ = *lc->mon_decimal_point;
@ -5342,7 +5342,7 @@ moneypunct_byname<wchar_t, false>::init(const char* nm)
if (loc == 0) if (loc == 0)
throw runtime_error("moneypunct_byname" throw runtime_error("moneypunct_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
lconv* lc = localeconv_l(loc.get()); lconv* lc = localeconv_l(loc.get());
if (*lc->mon_decimal_point) if (*lc->mon_decimal_point)
__decimal_point_ = static_cast<wchar_t>(*lc->mon_decimal_point); __decimal_point_ = static_cast<wchar_t>(*lc->mon_decimal_point);
@ -5403,7 +5403,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm)
if (loc == 0) if (loc == 0)
throw runtime_error("moneypunct_byname" throw runtime_error("moneypunct_byname"
" failed to construct for " + string(nm)); " failed to construct for " + string(nm));
#endif #endif // _LIBCPP_NO_EXCEPTIONS
lconv* lc = localeconv_l(loc.get()); lconv* lc = localeconv_l(loc.get());
if (*lc->mon_decimal_point) if (*lc->mon_decimal_point)
__decimal_point_ = static_cast<wchar_t>(*lc->mon_decimal_point); __decimal_point_ = static_cast<wchar_t>(*lc->mon_decimal_point);
@ -5526,4 +5526,4 @@ template class codecvt_byname<char32_t, char, mbstate_t>;
template class __vector_base_common<true>; template class __vector_base_common<true>;
_LIBCPP_END_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD
#endif /* __APPLE__ */ #endif // __APPLE__

@ -30,7 +30,6 @@ decrement(T& t)
} // namespace } // namespace
const allocator_arg_t allocator_arg = allocator_arg_t(); const allocator_arg_t allocator_arg = allocator_arg_t();
bad_weak_ptr::~bad_weak_ptr() throw() {} bad_weak_ptr::~bad_weak_ptr() throw() {}
@ -115,7 +114,7 @@ __shared_weak_count::__get_deleter(const type_info&) const
return 0; return 0;
} }
#endif #endif // _LIBCPP_NO_RTTI
void void
declare_reachable(void*) declare_reachable(void*)

@ -223,7 +223,7 @@ __call_once(volatile unsigned long& flag, void* arg, void(*func)(void*))
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
try try
{ {
#endif #endif // _LIBCPP_NO_EXCEPTIONS
flag = 1; flag = 1;
pthread_mutex_unlock(&mut); pthread_mutex_unlock(&mut);
func(arg); func(arg);
@ -241,7 +241,7 @@ __call_once(volatile unsigned long& flag, void* arg, void(*func)(void*))
pthread_cond_broadcast(&cv); pthread_cond_broadcast(&cv);
throw; throw;
} }
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
else else
pthread_mutex_unlock(&mut); pthread_mutex_unlock(&mut);

@ -11,23 +11,20 @@
#include "new" #include "new"
#if __APPLE__ #if __APPLE__
#include <cxxabi.h> #include <cxxabi.h>
// On Darwin, there are two STL shared libraries and a lower level ABI // On Darwin, there are two STL shared libraries and a lower level ABI
// shared libray. The global holding the current new handler is // shared libray. The global holding the current new handler is
// in the ABI library and named __cxa_new_handler. // in the ABI library and named __cxa_new_handler.
#define __new_handler __cxxabiapple::__cxa_new_handler #define __new_handler __cxxabiapple::__cxa_new_handler
#else #else // __APPLE__
static std::new_handler __new_handler; static std::new_handler __new_handler;
#endif #endif
// Implement all new and delete operators as weak definitions // Implement all new and delete operators as weak definitions
// in this shared library, so that they can be overriden by programs // in this shared library, so that they can be overriden by programs
// that define non-weak copies of the functions. // that define non-weak copies of the functions.
__attribute__((__weak__, __visibility__("default"))) __attribute__((__weak__, __visibility__("default")))
void * void *
operator new(std::size_t size) throw (std::bad_alloc) operator new(std::size_t size) throw (std::bad_alloc)
@ -37,7 +34,7 @@ operator new(std::size_t size) throw (std::bad_alloc)
void* p; void* p;
while ((p = ::malloc(size)) == 0) while ((p = ::malloc(size)) == 0)
{ {
// If malloc fails and there is a new_handler, // If malloc fails and there is a new_handler,
// call it to try free up memory. // call it to try free up memory.
if (__new_handler) if (__new_handler)
__new_handler(); __new_handler();
@ -59,14 +56,14 @@ operator new(size_t size, const std::nothrow_t&) throw()
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
try try
{ {
#endif #endif // _LIBCPP_NO_EXCEPTIONS
p = ::operator new(size); p = ::operator new(size);
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
} }
catch (...) catch (...)
{ {
} }
#endif #endif // _LIBCPP_NO_EXCEPTIONS
return p; return p;
} }
@ -85,14 +82,14 @@ operator new[](size_t size, const std::nothrow_t& nothrow) throw()
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
try try
{ {
#endif #endif // _LIBCPP_NO_EXCEPTIONS
p = ::operator new[](size); p = ::operator new[](size);
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
} }
catch (...) catch (...)
{ {
} }
#endif #endif // _LIBCPP_NO_EXCEPTIONS
return p; return p;
} }
@ -111,7 +108,6 @@ operator delete(void* ptr, const std::nothrow_t&) throw ()
::operator delete(ptr); ::operator delete(ptr);
} }
__attribute__((__weak__, __visibility__("default"))) __attribute__((__weak__, __visibility__("default")))
void void
operator delete[] (void* ptr) throw () operator delete[] (void* ptr) throw ()
@ -126,7 +122,6 @@ operator delete[] (void* ptr, const std::nothrow_t&) throw ()
::operator delete[](ptr); ::operator delete[](ptr);
} }
namespace std namespace std
{ {
@ -140,21 +135,20 @@ set_new_handler(new_handler handler) throw()
return r; return r;
} }
bad_alloc::bad_alloc() throw() bad_alloc::bad_alloc() throw()
{ {
} }
bad_alloc::~bad_alloc() throw() bad_alloc::~bad_alloc() throw()
{ {
} }
const char* const char*
bad_alloc::what() const throw() bad_alloc::what() const throw()
{ {
return "std::bad_alloc"; return "std::bad_alloc";
} }
bad_array_new_length::bad_array_new_length() throw() bad_array_new_length::bad_array_new_length() throw()
{ {
} }
@ -169,8 +163,6 @@ bad_array_new_length::what() const throw()
return "bad_array_new_length"; return "bad_array_new_length";
} }
void void
__throw_bad_alloc() __throw_bad_alloc()
{ {

@ -14,7 +14,6 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
_LIBCPP_BEGIN_NAMESPACE_STD _LIBCPP_BEGIN_NAMESPACE_STD
random_device::random_device(const string& __token) random_device::random_device(const string& __token)

@ -312,6 +312,4 @@ __match_any_but_newline<wchar_t>::__exec(__state& __s) const
} }
} }
_LIBCPP_END_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD

@ -83,7 +83,7 @@ stoi(const string& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stoi: no conversion"); throw invalid_argument("stoi: no conversion");
throw out_of_range("stoi: out of range"); throw out_of_range("stoi: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -104,7 +104,7 @@ stoi(const wstring& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stoi: no conversion"); throw invalid_argument("stoi: no conversion");
throw out_of_range("stoi: out of range"); throw out_of_range("stoi: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -123,7 +123,7 @@ stol(const string& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stol: no conversion"); throw invalid_argument("stol: no conversion");
throw out_of_range("stol: out of range"); throw out_of_range("stol: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -142,7 +142,7 @@ stol(const wstring& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stol: no conversion"); throw invalid_argument("stol: no conversion");
throw out_of_range("stol: out of range"); throw out_of_range("stol: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -161,7 +161,7 @@ stoul(const string& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stoul: no conversion"); throw invalid_argument("stoul: no conversion");
throw out_of_range("stoul: out of range"); throw out_of_range("stoul: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -180,7 +180,7 @@ stoul(const wstring& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stoul: no conversion"); throw invalid_argument("stoul: no conversion");
throw out_of_range("stoul: out of range"); throw out_of_range("stoul: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -199,7 +199,7 @@ stoll(const string& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stoll: no conversion"); throw invalid_argument("stoll: no conversion");
throw out_of_range("stoll: out of range"); throw out_of_range("stoll: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -218,7 +218,7 @@ stoll(const wstring& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stoll: no conversion"); throw invalid_argument("stoll: no conversion");
throw out_of_range("stoll: out of range"); throw out_of_range("stoll: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -237,7 +237,7 @@ stoull(const string& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stoull: no conversion"); throw invalid_argument("stoull: no conversion");
throw out_of_range("stoull: out of range"); throw out_of_range("stoull: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -256,7 +256,7 @@ stoull(const wstring& str, size_t* idx, int base)
if (r == 0) if (r == 0)
throw invalid_argument("stoull: no conversion"); throw invalid_argument("stoull: no conversion");
throw out_of_range("stoull: out of range"); throw out_of_range("stoull: out of range");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
@ -277,7 +277,7 @@ stof(const string& str, size_t* idx)
throw out_of_range("stof: out of range"); throw out_of_range("stof: out of range");
if (ptr == p) if (ptr == p)
throw invalid_argument("stof: no conversion"); throw invalid_argument("stof: no conversion");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
return static_cast<float>(r); return static_cast<float>(r);
@ -297,7 +297,7 @@ stof(const wstring& str, size_t* idx)
throw out_of_range("stof: out of range"); throw out_of_range("stof: out of range");
if (ptr == p) if (ptr == p)
throw invalid_argument("stof: no conversion"); throw invalid_argument("stof: no conversion");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
return static_cast<float>(r); return static_cast<float>(r);
@ -317,7 +317,7 @@ stod(const string& str, size_t* idx)
throw out_of_range("stod: out of range"); throw out_of_range("stod: out of range");
if (ptr == p) if (ptr == p)
throw invalid_argument("stod: no conversion"); throw invalid_argument("stod: no conversion");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
return r; return r;
@ -337,7 +337,7 @@ stod(const wstring& str, size_t* idx)
throw out_of_range("stod: out of range"); throw out_of_range("stod: out of range");
if (ptr == p) if (ptr == p)
throw invalid_argument("stod: no conversion"); throw invalid_argument("stod: no conversion");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
return r; return r;
@ -357,7 +357,7 @@ stold(const string& str, size_t* idx)
throw out_of_range("stold: out of range"); throw out_of_range("stold: out of range");
if (ptr == p) if (ptr == p)
throw invalid_argument("stold: no conversion"); throw invalid_argument("stold: no conversion");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
return r; return r;
@ -377,7 +377,7 @@ stold(const wstring& str, size_t* idx)
throw out_of_range("stold: out of range"); throw out_of_range("stold: out of range");
if (ptr == p) if (ptr == p)
throw invalid_argument("stold: no conversion"); throw invalid_argument("stold: no conversion");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
if (idx) if (idx)
*idx = static_cast<size_t>(ptr - p); *idx = static_cast<size_t>(ptr - p);
return r; return r;

@ -132,7 +132,7 @@ strstreambuf::operator=(strstreambuf&& __rhs)
__rhs.setp(nullptr, nullptr); __rhs.setp(nullptr, nullptr);
} }
#endif #endif // _LIBCPP_MOVE
strstreambuf::~strstreambuf() strstreambuf::~strstreambuf()
{ {
@ -257,7 +257,6 @@ strstreambuf::underflow()
return int_type((unsigned char)*gptr()); return int_type((unsigned char)*gptr());
} }
strstreambuf::pos_type strstreambuf::pos_type
strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __which) strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode __which)
{ {
@ -316,7 +315,6 @@ strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmod
return pos_type(__p); return pos_type(__p);
} }
strstreambuf::pos_type strstreambuf::pos_type
strstreambuf::seekpos(pos_type __sp, ios_base::openmode __which) strstreambuf::seekpos(pos_type __sp, ios_base::openmode __which)
{ {

@ -67,7 +67,7 @@ __generic_error_category::message(int ev) const
#ifdef ELAST #ifdef ELAST
if (ev > ELAST) if (ev > ELAST)
return string("unspecified generic_category error"); return string("unspecified generic_category error");
#endif #endif // ELAST
return __do_message::message(ev); return __do_message::message(ev);
} }
@ -99,7 +99,7 @@ __system_error_category::message(int ev) const
#ifdef ELAST #ifdef ELAST
if (ev > ELAST) if (ev > ELAST)
return string("unspecified system_category error"); return string("unspecified system_category error");
#endif #endif // ELAST
return __do_message::message(ev); return __do_message::message(ev);
} }
@ -109,7 +109,7 @@ __system_error_category::default_error_condition(int ev) const
#ifdef ELAST #ifdef ELAST
if (ev > ELAST) if (ev > ELAST)
return error_condition(ev, system_category()); return error_condition(ev, system_category());
#endif #endif // ELAST
return error_condition(ev, generic_category()); return error_condition(ev, generic_category());
} }

@ -27,7 +27,7 @@ thread::join()
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (ec) if (ec)
throw system_error(error_code(ec, system_category()), "thread::join failed"); throw system_error(error_code(ec, system_category()), "thread::join failed");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
__t_ = 0; __t_ = 0;
} }
@ -44,7 +44,7 @@ thread::detach()
#ifndef _LIBCPP_NO_EXCEPTIONS #ifndef _LIBCPP_NO_EXCEPTIONS
if (ec) if (ec)
throw system_error(error_code(ec, system_category()), "thread::detach failed"); throw system_error(error_code(ec, system_category()), "thread::detach failed");
#endif #endif // _LIBCPP_NO_EXCEPTIONS
} }
unsigned unsigned
@ -56,11 +56,11 @@ thread::hardware_concurrency()
std::size_t s = sizeof(n); std::size_t s = sizeof(n);
sysctl(mib, 2, &n, &s, 0, 0); sysctl(mib, 2, &n, &s, 0, 0);
return n; return n;
#else // !defined(CTL_HW && HW_NCPU) #else // defined(CTL_HW) && defined(HW_NCPU)
// TODO: grovel through /proc or check cpuid on x86 and similar // TODO: grovel through /proc or check cpuid on x86 and similar
// instructions on other architectures. // instructions on other architectures.
return 0; // Means not computable [thread.thread.static] return 0; // Means not computable [thread.thread.static]
#endif #endif // defined(CTL_HW) && defined(HW_NCPU)
} }
namespace this_thread namespace this_thread

@ -10,32 +10,30 @@
#include "typeinfo" #include "typeinfo"
std::bad_cast::bad_cast() throw() std::bad_cast::bad_cast() throw()
{ {
} }
std::bad_cast::~bad_cast() throw() std::bad_cast::~bad_cast() throw()
{ {
} }
const char* const char*
std::bad_cast::what() const throw() std::bad_cast::what() const throw()
{ {
return "std::bad_cast"; return "std::bad_cast";
} }
std::bad_typeid::bad_typeid() throw()
std::bad_typeid::bad_typeid() throw()
{
}
std::bad_typeid::~bad_typeid() throw()
{ {
} }
const char* std::bad_typeid::~bad_typeid() throw()
{
}
const char*
std::bad_typeid::what() const throw() std::bad_typeid::what() const throw()
{ {
return "std::bad_typeid"; return "std::bad_typeid";
} }