diff options
author | Tobias Markmann <tm@ayena.de> | 2014-10-19 20:22:58 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2014-10-20 13:49:33 (GMT) |
commit | 6b22dfcf59474dd016a0355a3102a1dd3692d92c (patch) | |
tree | 2b1fd33be433a91e81fee84fdc2bf1b52575d934 /3rdParty/Boost/src/boost/chrono/detail | |
parent | 38b0cb785fea8eae5e48fae56440695fdfd10ee1 (diff) | |
download | swift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.zip swift-6b22dfcf59474dd016a0355a3102a1dd3692d92c.tar.bz2 |
Update Boost in 3rdParty to version 1.56.0.
This updates Boost in our 3rdParty directory to version 1.56.0.
Updated our update.sh script to stop on error.
Changed error reporting in SwiftTools/CrashReporter.cpp to SWIFT_LOG due to
missing include of <iostream> with newer Boost.
Change-Id: I4b35c77de951333979a524097f35f5f83d325edc
Diffstat (limited to '3rdParty/Boost/src/boost/chrono/detail')
-rw-r--r-- | 3rdParty/Boost/src/boost/chrono/detail/inlined/win/chrono.hpp | 91 |
1 files changed, 40 insertions, 51 deletions
diff --git a/3rdParty/Boost/src/boost/chrono/detail/inlined/win/chrono.hpp b/3rdParty/Boost/src/boost/chrono/detail/inlined/win/chrono.hpp index 75160db..16e8c51 100644 --- a/3rdParty/Boost/src/boost/chrono/detail/inlined/win/chrono.hpp +++ b/3rdParty/Boost/src/boost/chrono/detail/inlined/win/chrono.hpp @@ -12,9 +12,9 @@ #ifndef BOOST_CHRONO_DETAIL_INLINED_WIN_CHRONO_HPP #define BOOST_CHRONO_DETAIL_INLINED_WIN_CHRONO_HPP -#include <boost/detail/win/time.hpp> -#include <boost/detail/win/timers.hpp> -#include <boost/detail/win/GetLastError.hpp> +#include <boost/detail/winapi/time.hpp> +#include <boost/detail/winapi/timers.hpp> +#include <boost/detail/winapi/GetLastError.hpp> namespace boost { @@ -25,8 +25,8 @@ namespace chrono_detail BOOST_CHRONO_INLINE double get_nanosecs_per_tic() BOOST_NOEXCEPT { - boost::detail::win32::LARGE_INTEGER_ freq; - if ( !boost::detail::win32::QueryPerformanceFrequency( &freq ) ) + boost::detail::winapi::LARGE_INTEGER_ freq; + if ( !boost::detail::winapi::QueryPerformanceFrequency( &freq ) ) return 0.0L; return double(1000000000.0L / freq.QuadPart); } @@ -35,15 +35,23 @@ namespace chrono_detail steady_clock::time_point steady_clock::now() BOOST_NOEXCEPT { - static double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic(); + double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic(); - boost::detail::win32::LARGE_INTEGER_ pcount; - if ( (nanosecs_per_tic <= 0.0L) || - (!boost::detail::win32::QueryPerformanceCounter( &pcount )) ) + boost::detail::winapi::LARGE_INTEGER_ pcount; + if ( nanosecs_per_tic <= 0.0L ) { - BOOST_ASSERT(0 && "Boost::Chrono - Internal Error"); + BOOST_ASSERT(0 && "Boost::Chrono - get_nanosecs_per_tic Internal Error"); return steady_clock::time_point(); } + unsigned times=0; + while ( ! boost::detail::winapi::QueryPerformanceCounter( &pcount ) ) + { + if ( ++times > 3 ) + { + BOOST_ASSERT(0 && "Boost::Chrono - QueryPerformanceCounter Internal Error"); + return steady_clock::time_point(); + } + } return steady_clock::time_point(steady_clock::duration( static_cast<steady_clock::rep>((nanosecs_per_tic) * pcount.QuadPart))); @@ -53,16 +61,16 @@ namespace chrono_detail #if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING steady_clock::time_point steady_clock::now( system::error_code & ec ) { - static double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic(); + double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic(); - boost::detail::win32::LARGE_INTEGER_ pcount; + boost::detail::winapi::LARGE_INTEGER_ pcount; if ( (nanosecs_per_tic <= 0.0L) - || (!boost::detail::win32::QueryPerformanceCounter( &pcount )) ) + || (!boost::detail::winapi::QueryPerformanceCounter( &pcount )) ) { - boost::detail::win32::DWORD_ cause = + boost::detail::winapi::DWORD_ cause = ((nanosecs_per_tic <= 0.0L) ? ERROR_NOT_SUPPORTED - : boost::detail::win32::GetLastError()); + : boost::detail::winapi::GetLastError()); if (BOOST_CHRONO_IS_THROWS(ec)) { boost::throw_exception( system::system_error( @@ -89,38 +97,33 @@ namespace chrono_detail BOOST_CHRONO_INLINE system_clock::time_point system_clock::now() BOOST_NOEXCEPT { - boost::detail::win32::FILETIME_ ft; - #if defined(UNDER_CE) - // Windows CE does not define GetSystemTimeAsFileTime so we do it in two steps. - boost::detail::win32::SYSTEMTIME_ st; - boost::detail::win32::GetSystemTime( &st ); - boost::detail::win32::SystemTimeToFileTime( &st, &ft ); - #else - boost::detail::win32::GetSystemTimeAsFileTime( &ft ); // never fails - #endif - return system_clock::time_point(system_clock::duration( - (static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime)); + boost::detail::winapi::FILETIME_ ft; + boost::detail::winapi::GetSystemTimeAsFileTime( &ft ); // never fails + return system_clock::time_point( + system_clock::duration( + ((static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime) + - 116444736000000000LL + //- (134775LL*864000000000LL) + ) + ); } #if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING BOOST_CHRONO_INLINE system_clock::time_point system_clock::now( system::error_code & ec ) { - boost::detail::win32::FILETIME_ ft; - #if defined(UNDER_CE) - // Windows CE does not define GetSystemTimeAsFileTime so we do it in two steps. - boost::detail::win32::SYSTEMTIME_ st; - boost::detail::win32::GetSystemTime( &st ); - boost::detail::win32::SystemTimeToFileTime( &st, &ft ); - #else - boost::detail::win32::GetSystemTimeAsFileTime( &ft ); // never fails - #endif + boost::detail::winapi::FILETIME_ ft; + boost::detail::winapi::GetSystemTimeAsFileTime( &ft ); // never fails if (!BOOST_CHRONO_IS_THROWS(ec)) { ec.clear(); } - return time_point(duration( - (static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime)); + return system_clock::time_point( + system_clock::duration( + ((static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime) + - 116444736000000000LL + //- (134775LL*864000000000LL) + )); } #endif @@ -128,13 +131,6 @@ namespace chrono_detail std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_NOEXCEPT { __int64 temp = t.time_since_epoch().count(); - - # if (!defined( BOOST_MSVC )) || (BOOST_MSVC > 1300) // > VC++ 7.0 - temp -= 116444736000000000LL; // delta from epoch in microseconds - # else - temp -= 116444736000000000; - # endif - temp /= 10000000; return static_cast<std::time_t>( temp ); } @@ -144,13 +140,6 @@ namespace chrono_detail { __int64 temp = t; temp *= 10000000; - - # if (!defined( BOOST_MSVC )) || (BOOST_MSVC > 1300) // > VC++ 7.0 - temp += 116444736000000000LL; - # else - temp += 116444736000000000; - # endif - return time_point(duration(temp)); } |