diff options
Diffstat (limited to 'system/lib')
-rw-r--r-- | system/lib/libcxx/chrono.cpp | 4 | ||||
-rw-r--r-- | system/lib/libcxx/debug.cpp | 4 | ||||
-rw-r--r-- | system/lib/libcxx/exception.cpp | 4 | ||||
-rw-r--r-- | system/lib/libcxx/iostream.cpp | 14 | ||||
-rw-r--r-- | system/lib/libcxx/locale.cpp | 18 | ||||
-rw-r--r-- | system/lib/libcxx/memory.cpp | 10 | ||||
-rw-r--r-- | system/lib/libcxx/new.cpp | 2 | ||||
-rw-r--r-- | system/lib/libcxx/readme.txt | 2 | ||||
-rw-r--r-- | system/lib/libcxx/stdexcept.cpp | 2 | ||||
-rw-r--r-- | system/lib/libcxx/string.cpp | 2 | ||||
-rw-r--r-- | system/lib/libcxx/strstream.cpp | 2 | ||||
-rw-r--r-- | system/lib/libcxx/symbols | 18 | ||||
-rw-r--r-- | system/lib/libcxx/thread.cpp | 4 | ||||
-rw-r--r-- | system/lib/libcxx/typeinfo.cpp | 4 |
14 files changed, 51 insertions, 39 deletions
diff --git a/system/lib/libcxx/chrono.cpp b/system/lib/libcxx/chrono.cpp index 1ce2e280..15a6f466 100644 --- a/system/lib/libcxx/chrono.cpp +++ b/system/lib/libcxx/chrono.cpp @@ -9,7 +9,7 @@ #include "chrono" #include <sys/time.h> //for gettimeofday and timeval -#if __APPLE__ +#ifdef __APPLE__ #include <mach/mach_time.h> // mach_absolute_time, mach_timebase_info_data_t #else /* !__APPLE__ */ #include <cerrno> // errno @@ -50,7 +50,7 @@ system_clock::from_time_t(time_t t) _NOEXCEPT const bool steady_clock::is_steady; -#if __APPLE__ +#ifdef __APPLE__ // mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of // nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom // are run time constants supplied by the OS. This clock has no relationship diff --git a/system/lib/libcxx/debug.cpp b/system/lib/libcxx/debug.cpp index f3a0262d..2d4b094b 100644 --- a/system/lib/libcxx/debug.cpp +++ b/system/lib/libcxx/debug.cpp @@ -17,7 +17,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -_LIBCPP_VISIBLE +_LIBCPP_FUNC_VIS __libcpp_db* __get_db() { @@ -25,7 +25,7 @@ __get_db() return &db; } -_LIBCPP_VISIBLE +_LIBCPP_FUNC_VIS const __libcpp_db* __get_const_db() { diff --git a/system/lib/libcxx/exception.cpp b/system/lib/libcxx/exception.cpp index 8d5ded4d..1d2f6b25 100644 --- a/system/lib/libcxx/exception.cpp +++ b/system/lib/libcxx/exception.cpp @@ -14,7 +14,7 @@ #define __has_include(inc) 0 #endif -#if __APPLE__ +#ifdef __APPLE__ #include <cxxabi.h> using namespace __cxxabiv1; @@ -104,7 +104,7 @@ terminate() _NOEXCEPT #if !defined(LIBCXXRT) && !defined(__GLIBCXX__) && !defined(EMSCRIPTEN) bool uncaught_exception() _NOEXCEPT { -#if __APPLE__ || defined(_LIBCPPABI_VERSION) +#if defined(__APPLE__) || defined(_LIBCPPABI_VERSION) // on Darwin, there is a helper function so __cxa_get_globals is private return __cxa_uncaught_exception(); #else // __APPLE__ diff --git a/system/lib/libcxx/iostream.cpp b/system/lib/libcxx/iostream.cpp index f5b959b4..7fc71df4 100644 --- a/system/lib/libcxx/iostream.cpp +++ b/system/lib/libcxx/iostream.cpp @@ -13,6 +13,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD +static mbstate_t state_types[6] = {}; + _ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)]; _ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)]; _ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)]; @@ -33,17 +35,17 @@ ios_base::Init __start_std_streams; ios_base::Init::Init() { - istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf <char>(stdin) ); - ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf<char>(stdout)); - ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr)); + istream* cin_ptr = ::new(cin) istream(::new(__cin) __stdinbuf <char>(stdin, state_types+0) ); + ostream* cout_ptr = ::new(cout) ostream(::new(__cout) __stdoutbuf<char>(stdout, state_types+1)); + ostream* cerr_ptr = ::new(cerr) ostream(::new(__cerr) __stdoutbuf<char>(stderr, state_types+2)); ::new(clog) ostream(cerr_ptr->rdbuf()); cin_ptr->tie(cout_ptr); _VSTD::unitbuf(*cerr_ptr); cerr_ptr->tie(cout_ptr); - wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf <wchar_t>(stdin) ); - wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout)); - wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf<wchar_t>(stderr)); + wistream* wcin_ptr = ::new(wcin) wistream(::new(__wcin) __stdinbuf <wchar_t>(stdin, state_types+3) ); + wostream* wcout_ptr = ::new(wcout) wostream(::new(__wcout) __stdoutbuf<wchar_t>(stdout, state_types+4)); + wostream* wcerr_ptr = ::new(wcerr) wostream(::new(__wcerr) __stdoutbuf<wchar_t>(stderr, state_types+5)); ::new(wclog) wostream(wcerr_ptr->rdbuf()); wcin_ptr->tie(wcout_ptr); _VSTD::unitbuf(*wcerr_ptr); diff --git a/system/lib/libcxx/locale.cpp b/system/lib/libcxx/locale.cpp index 35a65086..d9bc6f9a 100644 --- a/system/lib/libcxx/locale.cpp +++ b/system/lib/libcxx/locale.cpp @@ -25,7 +25,7 @@ #include "cstring" #include "cwctype" #include "__sso_allocator" -#if _WIN32 +#ifdef _WIN32 #include <support/win32/locale_win32.h> #else // _WIN32 #include <langinfo.h> @@ -993,11 +993,11 @@ ctype<char>::classic_table() _NOEXCEPT return __cloc()->__ctype_b; #elif __sun__ return __ctype_mask; -#elif _WIN32 +#elif defined(_WIN32) return _ctype+1; // internal ctype mask table defined in msvcrt.dll // This is assumed to be safe, which is a nonsense assumption because we're // going to end up dereferencing it later... -#elif EMSCRIPTEN +#elif defined(EMSCRIPTEN) return *__ctype_b_loc(); #else // Platform not supported: abort so the person doing the port knows what to @@ -5801,7 +5801,7 @@ moneypunct_byname<char, true>::init(const char* nm) __frac_digits_ = lc->int_frac_digits; else __frac_digits_ = base::do_frac_digits(); -#if _WIN32 +#ifdef _WIN32 if (lc->p_sign_posn == 0) #else // _WIN32 if (lc->int_p_sign_posn == 0) @@ -5809,7 +5809,7 @@ moneypunct_byname<char, true>::init(const char* nm) __positive_sign_ = "()"; else __positive_sign_ = lc->positive_sign; -#if _WIN32 +#ifdef _WIN32 if(lc->n_sign_posn == 0) #else // _WIN32 if (lc->int_n_sign_posn == 0) @@ -5821,7 +5821,7 @@ moneypunct_byname<char, true>::init(const char* nm) // the same places in curr_symbol since there's no way to // represent anything else. string_type __dummy_curr_symbol = __curr_symbol_; -#if _WIN32 +#ifdef _WIN32 __init_pat(__pos_format_, __dummy_curr_symbol, true, lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, ' '); __init_pat(__neg_format_, __curr_symbol_, true, @@ -5960,7 +5960,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm) __frac_digits_ = lc->int_frac_digits; else __frac_digits_ = base::do_frac_digits(); -#if _WIN32 +#ifdef _WIN32 if (lc->p_sign_posn == 0) #else // _WIN32 if (lc->int_p_sign_posn == 0) @@ -5980,7 +5980,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm) wbe = wbuf + j; __positive_sign_.assign(wbuf, wbe); } -#if _WIN32 +#ifdef _WIN32 if (lc->n_sign_posn == 0) #else // _WIN32 if (lc->int_n_sign_posn == 0) @@ -6004,7 +6004,7 @@ moneypunct_byname<wchar_t, true>::init(const char* nm) // the same places in curr_symbol since there's no way to // represent anything else. string_type __dummy_curr_symbol = __curr_symbol_; -#if _WIN32 +#ifdef _WIN32 __init_pat(__pos_format_, __dummy_curr_symbol, true, lc->p_cs_precedes, lc->p_sep_by_space, lc->p_sign_posn, L' '); __init_pat(__neg_format_, __curr_symbol_, true, diff --git a/system/lib/libcxx/memory.cpp b/system/lib/libcxx/memory.cpp index 14084a52..98bcc864 100644 --- a/system/lib/libcxx/memory.cpp +++ b/system/lib/libcxx/memory.cpp @@ -122,7 +122,15 @@ __shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT #if __has_feature(cxx_atomic) static const std::size_t __sp_mut_count = 16; -static mutex mut_back[__sp_mut_count]; +static pthread_mutex_t mut_back_imp[__sp_mut_count] = +{ + PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER +}; + +static mutex* mut_back = reinterpret_cast<std::mutex*>(mut_back_imp); _LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT : __lx(p) diff --git a/system/lib/libcxx/new.cpp b/system/lib/libcxx/new.cpp index 3ad593a3..b23a516f 100644 --- a/system/lib/libcxx/new.cpp +++ b/system/lib/libcxx/new.cpp @@ -15,7 +15,7 @@ #define __has_include(inc) 0 #endif -#if __APPLE__ +#ifdef __APPLE__ #include <cxxabi.h> #ifndef _LIBCPPABI_VERSION diff --git a/system/lib/libcxx/readme.txt b/system/lib/libcxx/readme.txt index c0c90c3a..97d8db86 100644 --- a/system/lib/libcxx/readme.txt +++ b/system/lib/libcxx/readme.txt @@ -1 +1 @@ -These files are from libc++, svn revision 176559, Mar 7 2013 +These files are from libc++, svn revision 178253, Mar 29 2013 diff --git a/system/lib/libcxx/stdexcept.cpp b/system/lib/libcxx/stdexcept.cpp index 660ebfe2..0c4e8323 100644 --- a/system/lib/libcxx/stdexcept.cpp +++ b/system/lib/libcxx/stdexcept.cpp @@ -20,7 +20,7 @@ #define __has_include(inc) 0 #endif -#if __APPLE__ +#ifdef __APPLE__ #include <cxxabi.h> #elif defined(LIBCXXRT) || __has_include(<cxxabi.h>) #include <cxxabi.h> diff --git a/system/lib/libcxx/string.cpp b/system/lib/libcxx/string.cpp index 40723e74..c71af4fe 100644 --- a/system/lib/libcxx/string.cpp +++ b/system/lib/libcxx/string.cpp @@ -11,7 +11,7 @@ #include "cstdlib" #include "cwchar" #include "cerrno" -#if _WIN32 +#ifdef _WIN32 #include "support/win32/support.h" #endif // _WIN32 diff --git a/system/lib/libcxx/strstream.cpp b/system/lib/libcxx/strstream.cpp index 8cd19e6a..518422bd 100644 --- a/system/lib/libcxx/strstream.cpp +++ b/system/lib/libcxx/strstream.cpp @@ -158,6 +158,8 @@ strstreambuf::overflow(int_type __c) return int_type(EOF); streamsize old_size = (epptr() ? epptr() : egptr()) - eback(); streamsize new_size = max<streamsize>(__alsize_, 2*old_size); + if (new_size == 0) + new_size = __default_alsize; char* buf = nullptr; if (__palloc_) buf = static_cast<char*>(__palloc_(static_cast<size_t>(new_size))); diff --git a/system/lib/libcxx/symbols b/system/lib/libcxx/symbols index 7e2072bc..93dfda65 100644 --- a/system/lib/libcxx/symbols +++ b/system/lib/libcxx/symbols @@ -766,8 +766,8 @@ C _ZNSt3__110__stdinbufIcE9__getcharEb C _ZNSt3__110__stdinbufIcE9pbackfailEi C _ZNSt3__110__stdinbufIcE9underflowEv - C _ZNSt3__110__stdinbufIcEC1EP7__sFILE - C _ZNSt3__110__stdinbufIcEC2EP7__sFILE + C _ZNSt3__110__stdinbufIcEC1EP7__sFILEP10_mbstate_t + C _ZNSt3__110__stdinbufIcEC2EP7__sFILEP10_mbstate_t C _ZNSt3__110__stdinbufIcED0Ev C _ZNSt3__110__stdinbufIcED1Ev C _ZNSt3__110__stdinbufIcED2Ev @@ -776,8 +776,8 @@ C _ZNSt3__110__stdinbufIwE9__getcharEb C _ZNSt3__110__stdinbufIwE9pbackfailEj C _ZNSt3__110__stdinbufIwE9underflowEv - C _ZNSt3__110__stdinbufIwEC1EP7__sFILE - C _ZNSt3__110__stdinbufIwEC2EP7__sFILE + C _ZNSt3__110__stdinbufIwEC1EP7__sFILEP10_mbstate_t + C _ZNSt3__110__stdinbufIwEC2EP7__sFILEP10_mbstate_t C _ZNSt3__110__stdinbufIwED0Ev C _ZNSt3__110__stdinbufIwED1Ev C _ZNSt3__110__stdinbufIwED2Ev @@ -882,16 +882,16 @@ C _ZNSt3__111__stdoutbufIcE4syncEv C _ZNSt3__111__stdoutbufIcE5imbueERKNS_6localeE C _ZNSt3__111__stdoutbufIcE8overflowEi - C _ZNSt3__111__stdoutbufIcEC1EP7__sFILE - C _ZNSt3__111__stdoutbufIcEC2EP7__sFILE + C _ZNSt3__111__stdoutbufIcEC1EP7__sFILEP10_mbstate_t + C _ZNSt3__111__stdoutbufIcEC2EP7__sFILEP10_mbstate_t C _ZNSt3__111__stdoutbufIcED0Ev C _ZNSt3__111__stdoutbufIcED1Ev C _ZNSt3__111__stdoutbufIcED2Ev C _ZNSt3__111__stdoutbufIwE4syncEv C _ZNSt3__111__stdoutbufIwE5imbueERKNS_6localeE C _ZNSt3__111__stdoutbufIwE8overflowEj - C _ZNSt3__111__stdoutbufIwEC1EP7__sFILE - C _ZNSt3__111__stdoutbufIwEC2EP7__sFILE + C _ZNSt3__111__stdoutbufIwEC1EP7__sFILEP10_mbstate_t + C _ZNSt3__111__stdoutbufIwEC2EP7__sFILEP10_mbstate_t C _ZNSt3__111__stdoutbufIwED0Ev C _ZNSt3__111__stdoutbufIwED1Ev C _ZNSt3__111__stdoutbufIwED2Ev @@ -2146,7 +2146,7 @@ C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE18__construct_at_endEj C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE18__construct_at_endIPS3_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_ C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE26__swap_out_circular_bufferERNS_14__split_bufferIS3_RS5_EE - C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE6assignIPS3_EENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_ + C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE6assignIPS3_EENS_9enable_ifIXaasr21__is_forward_iteratorIT_EE5valuesr16is_constructibleIS3_NS_15iterator_traitsISA_E9referenceEEE5valueEvE4typeESA_SA_ C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE6resizeEj C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE8__appendEj C _ZNSt3__16vectorIPNS_6locale5facetENS_15__sso_allocatorIS3_Lj28EEEE8allocateEj diff --git a/system/lib/libcxx/thread.cpp b/system/lib/libcxx/thread.cpp index a2d95bb2..76af3d0c 100644 --- a/system/lib/libcxx/thread.cpp +++ b/system/lib/libcxx/thread.cpp @@ -13,8 +13,8 @@ #include "future" #include "limits" #include <sys/types.h> -#if !_WIN32 -#if !__sun__ && !__linux__ +#if !defined(_WIN32) +#if !defined(__sun__) && !defined(__linux__) #include <sys/sysctl.h> #else #include <unistd.h> diff --git a/system/lib/libcxx/typeinfo.cpp b/system/lib/libcxx/typeinfo.cpp index 6bab0771..7b47d741 100644 --- a/system/lib/libcxx/typeinfo.cpp +++ b/system/lib/libcxx/typeinfo.cpp @@ -12,7 +12,7 @@ #define __has_include(inc) 0 #endif -#if __APPLE__ +#ifdef __APPLE__ #include <cxxabi.h> #elif defined(LIBCXXRT) || __has_include(<cxxabi.h>) #include <cxxabi.h> @@ -50,7 +50,7 @@ std::bad_typeid::what() const _NOEXCEPT return "std::bad_typeid"; } -#if __APPLE__ +#ifdef __APPLE__ // On Darwin, the cxa_bad_* functions cannot be in the lower level library // because bad_cast and bad_typeid are defined in his higher level library void __cxxabiv1::__cxa_bad_typeid() { throw std::bad_typeid(); } |