update boost on linux

This commit is contained in:
Bassem Girgis
2019-08-10 16:06:25 -05:00
parent 76ad52be58
commit 861b918727
5363 changed files with 483306 additions and 116507 deletions

View File

@@ -40,7 +40,7 @@ system_clock::now(system::error_code & ec)
{
timeval tv;
gettimeofday(&tv, 0);
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -89,7 +89,7 @@ BOOST_CHRONO_STATIC
steady_clock::rep
steady_simplified_ec(system::error_code & ec)
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -131,21 +131,21 @@ steady_full_ec(system::error_code & ec)
const double factor = chrono_detail::compute_steady_factor(err);
if (err != 0)
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
err,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::steady_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return steady_clock::rep();
}
}
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -217,21 +217,21 @@ steady_clock::now(system::error_code & ec)
chrono_detail::FP_ec fp = chrono_detail::init_steady_clock_ec(err);
if ( err != 0 )
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
err,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::steady_clock" ));
}
else
{
ec.assign( err, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( err, ::boost::system::system_category() );
return time_point();
}
}
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}

View File

@@ -95,12 +95,12 @@ namespace boost
clock_t c = ::times(&tm);
if (c == clock_t(-1)) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_real_cpu_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_real_cpu_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
} else
@@ -108,19 +108,19 @@ namespace boost
long factor = chrono_detail::tick_factor();
if (factor != -1)
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
return time_point(nanoseconds(c * factor));
} else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_real_cpu_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_real_cpu_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
}
@@ -129,12 +129,12 @@ namespace boost
clock_t c = ::clock();
if (c == clock_t(-1)) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_real_cpu_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_real_cpu_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
} else
@@ -142,19 +142,19 @@ namespace boost
long factor = chrono_detail::tick_factor();
if (factor != -1)
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
return time_point(nanoseconds(c * factor));
} else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_real_cpu_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_real_cpu_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
}
@@ -171,12 +171,12 @@ namespace boost
clock_t c = ::times(&tm);
if (c == clock_t(-1)) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_user_cpu_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_user_cpu_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
} else
@@ -184,19 +184,19 @@ namespace boost
long factor = chrono_detail::tick_factor();
if (factor != -1)
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
return time_point(nanoseconds((tm.tms_utime + tm.tms_cutime) * factor));
} else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_user_cpu_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_user_cpu_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
}
@@ -254,12 +254,12 @@ namespace boost
clock_t c = ::times(&tm);
if (c == clock_t(-1)) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_system_cpu_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_system_cpu_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
} else
@@ -267,19 +267,19 @@ namespace boost
long factor = chrono_detail::tick_factor();
if (factor != -1)
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
return time_point(nanoseconds((tm.tms_stime + tm.tms_cstime) * factor));
} else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_system_cpu_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_system_cpu_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
}
@@ -319,12 +319,12 @@ namespace boost
clock_t c = ::times(&tm);
if (c == clock_t(-1)) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
} else
@@ -338,12 +338,12 @@ namespace boost
return time_point(duration(r));
} else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(system::system_error(errno, BOOST_CHRONO_SYSTEM_CATEGORY, "chrono::process_clock"));
boost::throw_exception(system::system_error(errno, ::boost::system::system_category(), "chrono::process_clock"));
} else
{
ec.assign(errno, BOOST_CHRONO_SYSTEM_CATEGORY);
ec.assign(errno, ::boost::system::system_category());
return time_point();
}
}

View File

@@ -58,21 +58,21 @@ namespace boost { namespace chrono {
mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
if ( thread_info(port, THREAD_BASIC_INFO, (thread_info_t)&info, &count) != KERN_SUCCESS )
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
EINVAL,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::thread_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}

View File

@@ -12,6 +12,7 @@
#include <time.h> // for clock_gettime
#include <boost/assert.hpp>
#include <boost/predef/os.h>
namespace boost
{
@@ -36,22 +37,22 @@ namespace chrono
timespec ts;
if ( ::clock_gettime( CLOCK_REALTIME, &ts ) )
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::system_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -75,11 +76,20 @@ namespace chrono
steady_clock::time_point steady_clock::now() BOOST_NOEXCEPT
{
timespec ts;
if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) )
#if BOOST_OS_CYGWIN
// lack of thread safety in high resolution timer initialization
// can lead to a timespec of zero without an error; was reported
// to the cygwin mailing list and can be removed once fixed
do
{
BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
}
#endif
if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) )
{
BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
}
#if BOOST_OS_CYGWIN
} while (ts.tv_sec == 0 && ts.tv_nsec == 0);
#endif
return time_point(duration(
static_cast<steady_clock::rep>( ts.tv_sec ) * 1000000000 + ts.tv_nsec));
}
@@ -88,24 +98,34 @@ namespace chrono
steady_clock::time_point steady_clock::now(system::error_code & ec)
{
timespec ts;
if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) )
#if BOOST_OS_CYGWIN
// lack of thread safety in high resolution timer initialization
// can lead to a timespec of zero without an error; was reported
// to the cygwin mailing list and can be removed once fixed
do
{
if (BOOST_CHRONO_IS_THROWS(ec))
#endif
if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) )
{
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::steady_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
}
#if BOOST_OS_CYGWIN
} while (ts.tv_sec == 0 && ts.tv_nsec == 0);
#endif
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}

View File

@@ -73,17 +73,17 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now(
clock_t c = ::times( &tm );
if ( c == clock_t(-1) ) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_real_cpu_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
@@ -91,7 +91,7 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now(
{
if ( chrono_detail::tick_factor() != -1 )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -100,17 +100,17 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now(
}
else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_real_cpu_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
@@ -149,17 +149,17 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
clock_t c = ::times( &tm );
if ( c == clock_t(-1) ) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_user_cpu_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
@@ -167,7 +167,7 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
{
if ( chrono_detail::tick_factor() != -1 )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -176,17 +176,17 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
}
else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_user_cpu_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
@@ -226,17 +226,17 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now(
clock_t c = ::times( &tm );
if ( c == clock_t(-1) ) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_system_cpu_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
@@ -244,7 +244,7 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now(
{
if ( chrono_detail::tick_factor() != -1 )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -253,17 +253,17 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now(
}
else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_system_cpu_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
@@ -306,17 +306,17 @@ process_cpu_clock::time_point process_cpu_clock::now(
clock_t c = ::times( &tm );
if ( c == clock_t(-1) ) // error
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
@@ -332,17 +332,17 @@ process_cpu_clock::time_point process_cpu_clock::now(
}
else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}

View File

@@ -65,21 +65,21 @@ namespace boost { namespace chrono {
if ( ::clock_gettime( clock_id, &ts ) )
#endif
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::thread_clock" ));
}
else
{
ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( errno, ::boost::system::system_category() );
return time_point();
}
}
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}

View File

@@ -12,9 +12,9 @@
#ifndef BOOST_CHRONO_DETAIL_INLINED_WIN_CHRONO_HPP
#define BOOST_CHRONO_DETAIL_INLINED_WIN_CHRONO_HPP
#include <boost/detail/winapi/time.hpp>
#include <boost/detail/winapi/timers.hpp>
#include <boost/detail/winapi/get_last_error.hpp>
#include <boost/winapi/time.hpp>
#include <boost/winapi/timers.hpp>
#include <boost/winapi/get_last_error.hpp>
#include <boost/assert.hpp>
namespace boost
@@ -26,8 +26,8 @@ namespace chrono_detail
BOOST_CHRONO_INLINE double get_nanosecs_per_tic() BOOST_NOEXCEPT
{
boost::detail::winapi::LARGE_INTEGER_ freq;
if ( !boost::detail::winapi::QueryPerformanceFrequency( &freq ) )
boost::winapi::LARGE_INTEGER_ freq;
if ( !boost::winapi::QueryPerformanceFrequency( &freq ) )
return 0.0L;
return double(1000000000.0L / freq.QuadPart);
}
@@ -38,14 +38,14 @@ namespace chrono_detail
{
double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic();
boost::detail::winapi::LARGE_INTEGER_ pcount;
boost::winapi::LARGE_INTEGER_ pcount;
if ( nanosecs_per_tic <= 0.0L )
{
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 ) )
while ( ! boost::winapi::QueryPerformanceCounter( &pcount ) )
{
if ( ++times > 3 )
{
@@ -64,29 +64,29 @@ namespace chrono_detail
{
double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic();
boost::detail::winapi::LARGE_INTEGER_ pcount;
boost::winapi::LARGE_INTEGER_ pcount;
if ( (nanosecs_per_tic <= 0.0L)
|| (!boost::detail::winapi::QueryPerformanceCounter( &pcount )) )
|| (!boost::winapi::QueryPerformanceCounter( &pcount )) )
{
boost::detail::winapi::DWORD_ cause =
boost::winapi::DWORD_ cause =
((nanosecs_per_tic <= 0.0L)
? ERROR_NOT_SUPPORTED
: boost::detail::winapi::GetLastError());
if (BOOST_CHRONO_IS_THROWS(ec)) {
: boost::winapi::GetLastError());
if (::boost::chrono::is_throws(ec)) {
boost::throw_exception(
system::system_error(
cause,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::steady_clock" ));
}
else
{
ec.assign( cause, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( cause, ::boost::system::system_category() );
return steady_clock::time_point(duration(0));
}
}
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -98,8 +98,8 @@ namespace chrono_detail
BOOST_CHRONO_INLINE
system_clock::time_point system_clock::now() BOOST_NOEXCEPT
{
boost::detail::winapi::FILETIME_ ft;
boost::detail::winapi::GetSystemTimeAsFileTime( &ft ); // never fails
boost::winapi::FILETIME_ ft;
boost::winapi::GetSystemTimeAsFileTime( &ft ); // never fails
return system_clock::time_point(
system_clock::duration(
((static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime)
@@ -113,9 +113,9 @@ namespace chrono_detail
BOOST_CHRONO_INLINE
system_clock::time_point system_clock::now( system::error_code & ec )
{
boost::detail::winapi::FILETIME_ ft;
boost::detail::winapi::GetSystemTimeAsFileTime( &ft ); // never fails
if (!BOOST_CHRONO_IS_THROWS(ec))
boost::winapi::FILETIME_ ft;
boost::winapi::GetSystemTimeAsFileTime( &ft ); // never fails
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}

View File

@@ -53,10 +53,10 @@ process_real_cpu_clock::time_point process_real_cpu_clock::now(
boost::throw_exception(
system::system_error(
errno,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_real_cpu_clock" ));
}
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -103,7 +103,7 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -115,17 +115,17 @@ process_user_cpu_clock::time_point process_user_cpu_clock::now(
else
{
boost::detail::winapi::DWORD_ cause = boost::detail::winapi::GetLastError();
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
cause,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_user_cpu_clock" ));
}
else
{
ec.assign( cause, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( cause, ::boost::system::system_category() );
return time_point();
}
}
@@ -168,7 +168,7 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now(
boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -180,17 +180,17 @@ process_system_cpu_clock::time_point process_system_cpu_clock::now(
else
{
boost::detail::winapi::DWORD_ cause = boost::detail::winapi::GetLastError();
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
cause,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_system_cpu_clock" ));
}
else
{
ec.assign( cause, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( cause, ::boost::system::system_category() );
return time_point();
}
}
@@ -239,7 +239,7 @@ process_cpu_clock::time_point process_cpu_clock::now(
boost::detail::winapi::GetCurrentProcess(), &creation, &exit,
&system_time, &user_time ) )
{
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -257,17 +257,17 @@ process_cpu_clock::time_point process_cpu_clock::now(
else
{
boost::detail::winapi::DWORD_ cause = boost::detail::winapi::GetLastError();
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
cause,
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::process_cpu_clock" ));
}
else
{
ec.assign( cause, BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( cause, ::boost::system::system_category() );
return time_point();
}
}

View File

@@ -43,7 +43,7 @@ thread_clock::time_point thread_clock::now( system::error_code & ec )
((static_cast<duration::rep>(system_time.dwHighDateTime) << 32)
| system_time.dwLowDateTime) * 100 );
if (!BOOST_CHRONO_IS_THROWS(ec))
if (!::boost::chrono::is_throws(ec))
{
ec.clear();
}
@@ -52,17 +52,17 @@ thread_clock::time_point thread_clock::now( system::error_code & ec )
}
else
{
if (BOOST_CHRONO_IS_THROWS(ec))
if (::boost::chrono::is_throws(ec))
{
boost::throw_exception(
system::system_error(
boost::detail::winapi::GetLastError(),
BOOST_CHRONO_SYSTEM_CATEGORY,
::boost::system::system_category(),
"chrono::thread_clock" ));
}
else
{
ec.assign( boost::detail::winapi::GetLastError(), BOOST_CHRONO_SYSTEM_CATEGORY );
ec.assign( boost::detail::winapi::GetLastError(), ::boost::system::system_category() );
return thread_clock::time_point(duration(0));
}
}

View File

@@ -8,22 +8,13 @@
#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
#include <boost/version.hpp>
#include <boost/system/error_code.hpp>
#if ((BOOST_VERSION / 100000) < 2) && ((BOOST_VERSION / 100 % 1000) < 44)
#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category
#else
#define BOOST_CHRONO_SYSTEM_CATEGORY boost::system::system_category()
#endif
#ifdef BOOST_SYSTEM_NO_DEPRECATED
#define BOOST_CHRONO_THROWS boost::throws()
#define BOOST_CHRONO_IS_THROWS(EC) (&EC==&boost::throws())
#else
#define BOOST_CHRONO_THROWS boost::system::throws
#define BOOST_CHRONO_IS_THROWS(EC) (&EC==&boost::system::throws)
#endif
namespace boost {
namespace chrono {
inline bool is_throws(system::error_code & ec) { return (&ec==&boost::throws()); }
}
}
#endif
#endif

View File

@@ -433,12 +433,13 @@ namespace chrono {
rep rep_;
public:
#if defined BOOST_NO_CXX11_DEFAULTED_FUNCTIONS || \
defined BOOST_CHRONO_DURATION_DEFAULTS_TO_ZERO
#if defined BOOST_CHRONO_DURATION_DEFAULTS_TO_ZERO
BOOST_FORCEINLINE BOOST_CONSTEXPR
duration() : rep_(duration_values<rep>::zero()) { }
#elif defined BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
BOOST_CONSTEXPR duration() {}
#else
BOOST_CONSTEXPR duration() BOOST_NOEXCEPT : rep_() {};
BOOST_CONSTEXPR duration() = default;
#endif
template <class Rep2>
BOOST_SYMBOL_VISIBLE BOOST_FORCEINLINE BOOST_CONSTEXPR
@@ -542,8 +543,8 @@ namespace chrono {
const duration<Rep2, Period2>& rhs)
{
typedef typename common_type<duration<Rep1, Period1>,
duration<Rep2, Period2> >::type CD;
return CD(CD(lhs).count()+CD(rhs).count());
duration<Rep2, Period2> >::type common_duration;
return common_duration(common_duration(lhs).count()+common_duration(rhs).count());
}
// Duration -
@@ -555,8 +556,8 @@ namespace chrono {
const duration<Rep2, Period2>& rhs)
{
typedef typename common_type<duration<Rep1, Period1>,
duration<Rep2, Period2> >::type CD;
return CD(CD(lhs).count()-CD(rhs).count());
duration<Rep2, Period2> >::type common_duration;
return common_duration(common_duration(lhs).count()-common_duration(rhs).count());
}
// Duration *
@@ -572,9 +573,9 @@ namespace chrono {
>::type
operator*(const duration<Rep1, Period>& d, const Rep2& s)
{
typedef typename common_type<Rep1, Rep2>::type CR;
typedef duration<CR, Period> CD;
return CD(CD(d).count()*static_cast<CR>(s));
typedef typename common_type<Rep1, Rep2>::type common_rep;
typedef duration<common_rep, Period> common_duration;
return common_duration(common_duration(d).count()*static_cast<common_rep>(s));
}
template <class Rep1, class Period, class Rep2>
@@ -601,10 +602,9 @@ namespace chrono {
>::type
operator/(const duration<Rep1, Period>& d, const Rep2& s)
{
typedef typename common_type<Rep1, Rep2>::type CR;
typedef duration<CR, Period> CD;
return CD(CD(d).count()/static_cast<CR>(s));
typedef typename common_type<Rep1, Rep2>::type common_rep;
typedef duration<common_rep, Period> common_duration;
return common_duration(common_duration(d).count()/static_cast<common_rep>(s));
}
template <class Rep1, class Period1, class Rep2, class Period2>
@@ -613,8 +613,8 @@ namespace chrono {
operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs)
{
typedef typename common_type<duration<Rep1, Period1>,
duration<Rep2, Period2> >::type CD;
return CD(lhs).count() / CD(rhs).count();
duration<Rep2, Period2> >::type common_duration;
return common_duration(lhs).count() / common_duration(rhs).count();
}
#ifdef BOOST_CHRONO_EXTENSIONS
@@ -626,10 +626,9 @@ namespace chrono {
>::type
operator/(const Rep1& s, const duration<Rep2, Period>& d)
{
typedef typename common_type<Rep1, Rep2>::type CR;
typedef duration<CR, Period> CD;
return static_cast<CR>(s)/CD(d).count();
typedef typename common_type<Rep1, Rep2>::type common_rep;
typedef duration<common_rep, Period> common_duration;
return static_cast<common_rep>(s)/common_duration(d).count();
}
#endif
// Duration %
@@ -642,10 +641,9 @@ namespace chrono {
>::type
operator%(const duration<Rep1, Period>& d, const Rep2& s)
{
typedef typename common_type<Rep1, Rep2>::type CR;
typedef duration<CR, Period> CD;
return CD(CD(d).count()%static_cast<CR>(s));
typedef typename common_type<Rep1, Rep2>::type common_rep;
typedef duration<common_rep, Period> common_duration;
return common_duration(common_duration(d).count()%static_cast<common_rep>(s));
}
template <class Rep1, class Period1, class Rep2, class Period2>
@@ -654,9 +652,9 @@ namespace chrono {
operator%(const duration<Rep1, Period1>& lhs,
const duration<Rep2, Period2>& rhs) {
typedef typename common_type<duration<Rep1, Period1>,
duration<Rep2, Period2> >::type CD;
duration<Rep2, Period2> >::type common_duration;
return CD(CD(lhs).count()%CD(rhs).count());
return common_duration(common_duration(lhs).count()%common_duration(rhs).count());
}
@@ -671,8 +669,8 @@ namespace detail
{
BOOST_CONSTEXPR bool operator()(const LhsDuration& lhs, const RhsDuration& rhs) const
{
typedef typename common_type<LhsDuration, RhsDuration>::type CD;
return CD(lhs).count() == CD(rhs).count();
typedef typename common_type<LhsDuration, RhsDuration>::type common_duration;
return common_duration(lhs).count() == common_duration(rhs).count();
}
};
@@ -690,8 +688,8 @@ namespace detail
{
BOOST_CONSTEXPR bool operator()(const LhsDuration& lhs, const RhsDuration& rhs) const
{
typedef typename common_type<LhsDuration, RhsDuration>::type CD;
return CD(lhs).count() < CD(rhs).count();
typedef typename common_type<LhsDuration, RhsDuration>::type common_duration;
return common_duration(lhs).count() < common_duration(rhs).count();
}
};

View File

@@ -309,8 +309,7 @@ namespace boost
t /= den;
if (t > duration_values<common_type_t>::zero())
{
Rep pt = t;
if ( (duration_values<Rep>::max)() < pt)
if ( (duration_values<Rep>::max)() < Rep(t))
{
// Conversion to Period overflowed
err |= std::ios_base::failbit;
@@ -318,8 +317,7 @@ namespace boost
}
}
// Success! Store it.
r = Rep(t);
d = duration<Rep, Period> (r);
d = duration<Rep, Period> (Rep(t));
return s;
}

View File

@@ -21,7 +21,7 @@
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <locale>
#include <iostream>
#include <iosfwd>
#include <sstream>
namespace boost

View File

@@ -34,20 +34,22 @@
#include <locale>
#include <ctime>
#define BOOST_CHRONO_INTERNAL_TIMEGM \
( defined BOOST_WINDOWS && ! defined(__CYGWIN__) ) \
#if ( defined BOOST_WINDOWS && ! defined(__CYGWIN__) ) \
|| (defined(sun) || defined(__sun)) \
|| (defined __IBMCPP__) \
|| defined __ANDROID__ \
|| defined __QNXNTO__ \
|| (defined(_AIX) && defined __GNUC__)
#define BOOST_CHRONO_INTERNAL_TIMEGM
#endif
#define BOOST_CHRONO_INTERNAL_GMTIME \
(defined BOOST_WINDOWS && ! defined(__CYGWIN__)) \
#if (defined BOOST_WINDOWS && ! defined(__CYGWIN__)) \
|| ( (defined(sun) || defined(__sun)) && defined __GNUC__) \
|| (defined __IBMCPP__) \
|| defined __ANDROID__ \
|| (defined(_AIX) && defined __GNUC__)
#define BOOST_CHRONO_INTERNAL_GMTIME
#endif
#define BOOST_CHRONO_USES_INTERNAL_TIME_GET
@@ -746,7 +748,7 @@ namespace boost
namespace detail
{
//#if BOOST_CHRONO_INTERNAL_TIMEGM
//#if defined BOOST_CHRONO_INTERNAL_TIMEGM
inline int32_t is_leap(int32_t year)
{
@@ -765,7 +767,7 @@ namespace boost
}
inline int32_t days_from_1970(int32_t year)
{
static const int days_from_0_to_1970 = days_from_0(1970);
static const int32_t days_from_0_to_1970 = days_from_0(1970);
return days_from_0(year) - days_from_0_to_1970;
}
inline int32_t days_from_1jan(int32_t year,int32_t month,int32_t day)
@@ -938,18 +940,22 @@ namespace boost
if (tz == timezone::local)
{
#if defined BOOST_WINDOWS && ! defined(__CYGWIN__)
#if BOOST_MSVC < 1400 // localtime_s doesn't exist in vc7.1
std::tm *tmp = 0;
if ((tmp=localtime(&t)) == 0)
failed = true;
else
tm =*tmp;
# else
if (localtime_s(&tm, &t) != 0) failed = true;
# endif
#else
if (localtime_r(&t, &tm) == 0) failed = true;
#endif
}
else
{
#if BOOST_CHRONO_INTERNAL_GMTIME
#if defined BOOST_CHRONO_INTERNAL_GMTIME
if (detail::internal_gmtime(&t, &tm) == 0) failed = true;
#elif defined BOOST_WINDOWS && ! defined(__CYGWIN__)
@@ -1157,7 +1163,7 @@ namespace boost
if (err & std::ios_base::failbit) goto exit;
time_t t;
#if BOOST_CHRONO_INTERNAL_TIMEGM
#if defined BOOST_CHRONO_INTERNAL_TIMEGM
t = detail::internal_timegm(&tm);
#else
t = timegm(&tm);
@@ -1209,7 +1215,7 @@ namespace boost
time_t t;
if (tz == timezone::utc || fz != pe)
{
#if BOOST_CHRONO_INTERNAL_TIMEGM
#if defined BOOST_CHRONO_INTERNAL_TIMEGM
t = detail::internal_timegm(&tm);
#else
t = timegm(&tm);

View File

@@ -15,7 +15,7 @@
#include <boost/chrono/thread_clock.hpp>
#include <boost/chrono/io/ios_base_state.hpp>
#include <string>
#include <iostream>
#include <iosfwd>
#include <ios>
#include <locale>
#include <algorithm>

View File

@@ -549,8 +549,7 @@ operator>>(std::basic_istream<CharT, Traits>& is, duration<Rep, Period>& d)
if (t > duration_values<common_type_t>::zero())
{
//std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
Rep pt = t;
if ( (duration_values<Rep>::max)() < pt)
if ( (duration_values<Rep>::max)() < Rep(t))
{
//std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
// Conversion to Period overflowed
@@ -560,8 +559,7 @@ operator>>(std::basic_istream<CharT, Traits>& is, duration<Rep, Period>& d)
}
//std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
// Success! Store it.
r = Rep(t);
d = duration<Rep, Period>(r);
d = duration<Rep, Period>(Rep(t));
is.setstate(err);
//std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
return is;

View File

@@ -20,7 +20,7 @@
#include <boost/chrono/time_point.hpp>
#include <boost/operators.hpp>
#include <boost/chrono/detail/system.hpp>
#include <iostream>
#include <iosfwd>
#include <boost/type_traits/common_type.hpp>
#include <boost/chrono/clock_string.hpp>
@@ -476,7 +476,7 @@ namespace std {
(std::numeric_limits<Rep>::max)(),
(std::numeric_limits<Rep>::max)());
}
static Res lowest() throw()
static Res lowest() BOOST_NOEXCEPT_OR_NOTHROW
{
return (min)();
}

View File

@@ -96,9 +96,9 @@ namespace boost {
namespace chrono {
// Clocks
class BOOST_CHRONO_DECL system_clock;
class system_clock;
#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
class BOOST_CHRONO_DECL steady_clock;
class steady_clock;
#endif
#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY

View File

@@ -31,7 +31,6 @@ time2_demo contained this comment:
#define BOOST_CHRONO_TIME_POINT_HPP
#include <boost/chrono/duration.hpp>
#include <iostream>
#ifndef BOOST_CHRONO_HEADER_ONLY
// this must occur after all of the includes and before any code appears: