1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-19 03:48:57 +00:00
nixpkgs/pkgs/development/libraries/boost/time_utc_144.patch

521 lines
17 KiB
Diff

diff -rc boost_1_44_0/boost/thread/xtime.hpp boost_1_44_0-new/boost/thread/xtime.hpp
*** boost_1_44_0/boost/thread/xtime.hpp 2008-06-18 15:01:08.000000000 +0200
--- boost_1_44_0-new/boost/thread/xtime.hpp 2013-04-12 14:00:27.125713549 +0200
***************
*** 20,26 ****
enum xtime_clock_types
{
! TIME_UTC=1
// TIME_TAI,
// TIME_MONOTONIC,
// TIME_PROCESS,
--- 20,26 ----
enum xtime_clock_types
{
! TIME_UTC_=1
// TIME_TAI,
// TIME_MONOTONIC,
// TIME_PROCESS,
***************
*** 68,74 ****
inline int xtime_get(struct xtime* xtp, int clock_type)
{
! if (clock_type == TIME_UTC)
{
*xtp=get_xtime(get_system_time());
return clock_type;
--- 68,74 ----
inline int xtime_get(struct xtime* xtp, int clock_type)
{
! if (clock_type == TIME_UTC_)
{
*xtp=get_xtime(get_system_time());
return clock_type;
diff -rc boost_1_44_0/libs/interprocess/test/condition_test_template.hpp boost_1_44_0-new/libs/interprocess/test/condition_test_template.hpp
*** boost_1_44_0/libs/interprocess/test/condition_test_template.hpp 2009-10-15 20:45:53.000000000 +0200
--- boost_1_44_0-new/libs/interprocess/test/condition_test_template.hpp 2013-04-12 14:00:20.215658855 +0200
***************
*** 49,56 ****
const int NANOSECONDS_PER_MILLISECOND = 1000000;
boost::xtime xt;
! int ret = boost::xtime_get(&xt, boost::TIME_UTC);
! assert(ret == static_cast<int>(boost::TIME_UTC));(void)ret;
nsecs += xt.nsec;
msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
secs += msecs / MILLISECONDS_PER_SECOND;
--- 49,56 ----
const int NANOSECONDS_PER_MILLISECOND = 1000000;
boost::xtime xt;
! int ret = boost::xtime_get(&xt, boost::TIME_UTC_);
! assert(ret == static_cast<int>(boost::TIME_UTC_));(void)ret;
nsecs += xt.nsec;
msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
secs += msecs / MILLISECONDS_PER_SECOND;
diff -rc boost_1_44_0/libs/interprocess/test/util.hpp boost_1_44_0-new/libs/interprocess/test/util.hpp
*** boost_1_44_0/libs/interprocess/test/util.hpp 2009-10-15 20:45:53.000000000 +0200
--- boost_1_44_0-new/libs/interprocess/test/util.hpp 2013-04-12 14:00:20.219658887 +0200
***************
*** 71,77 ****
boost::xtime xsecs(int secs)
{
boost::xtime ret;
! boost::xtime_get(&ret, boost::TIME_UTC);
ret.sec += secs;
return ret;
}
--- 71,77 ----
boost::xtime xsecs(int secs)
{
boost::xtime ret;
! boost::xtime_get(&ret, boost::TIME_UTC_);
ret.sec += secs;
return ret;
}
diff -rc boost_1_44_0/libs/spirit/classic/test/grammar_mt_tests.cpp boost_1_44_0-new/libs/spirit/classic/test/grammar_mt_tests.cpp
*** boost_1_44_0/libs/spirit/classic/test/grammar_mt_tests.cpp 2008-06-22 17:05:38.000000000 +0200
--- boost_1_44_0-new/libs/spirit/classic/test/grammar_mt_tests.cpp 2013-04-12 14:00:18.836647940 +0200
***************
*** 70,76 ****
{
static long const nanoseconds_per_second = 1000L*1000L*1000L;
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC);
xt.nsec+=1000*1000*milliseconds;
while (xt.nsec > nanoseconds_per_second)
{
--- 70,76 ----
{
static long const nanoseconds_per_second = 1000L*1000L*1000L;
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC_);
xt.nsec+=1000*1000*milliseconds;
while (xt.nsec > nanoseconds_per_second)
{
diff -rc boost_1_44_0/libs/spirit/classic/test/owi_mt_tests.cpp boost_1_44_0-new/libs/spirit/classic/test/owi_mt_tests.cpp
*** boost_1_44_0/libs/spirit/classic/test/owi_mt_tests.cpp 2008-06-22 17:05:38.000000000 +0200
--- boost_1_44_0-new/libs/spirit/classic/test/owi_mt_tests.cpp 2013-04-12 14:00:18.836647940 +0200
***************
*** 86,92 ****
return test_size;
boost::xtime now;
! boost::xtime_get(&now, boost::TIME_UTC);
unsigned long seconds = now.sec - start_time.sec;
if (seconds < 4)
{
--- 86,92 ----
return test_size;
boost::xtime now;
! boost::xtime_get(&now, boost::TIME_UTC_);
unsigned long seconds = now.sec - start_time.sec;
if (seconds < 4)
{
***************
*** 187,193 ****
void concurrent_creation_of_objects()
{
{
! boost::xtime_get(&start_time, boost::TIME_UTC);
boost::thread thread1(callable_ref(test1));
boost::thread thread2(callable_ref(test2));
boost::thread thread3(callable_ref(test3));
--- 187,193 ----
void concurrent_creation_of_objects()
{
{
! boost::xtime_get(&start_time, boost::TIME_UTC_);
boost::thread thread1(callable_ref(test1));
boost::thread thread2(callable_ref(test2));
boost::thread thread3(callable_ref(test3));
diff -rc boost_1_44_0/libs/thread/example/starvephil.cpp boost_1_44_0-new/libs/thread/example/starvephil.cpp
*** boost_1_44_0/libs/thread/example/starvephil.cpp 2006-09-14 23:51:01.000000000 +0200
--- boost_1_44_0-new/libs/thread/example/starvephil.cpp 2013-04-12 14:00:19.413652507 +0200
***************
*** 50,56 ****
<< "very hot ..." << std::endl;
}
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC);
xt.sec += 3;
boost::thread::sleep(xt);
m_chickens += value;
--- 50,56 ----
<< "very hot ..." << std::endl;
}
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC_);
xt.sec += 3;
boost::thread::sleep(xt);
m_chickens += value;
***************
*** 85,91 ****
std::cout << "(" << clock() << ") Chef: cooking ..." << std::endl;
}
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC);
xt.sec += 2;
boost::thread::sleep(xt);
{
--- 85,91 ----
std::cout << "(" << clock() << ") Chef: cooking ..." << std::endl;
}
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC_);
xt.sec += 2;
boost::thread::sleep(xt);
{
***************
*** 111,117 ****
if (m_id > 0)
{
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC);
xt.sec += 3;
boost::thread::sleep(xt);
}
--- 111,117 ----
if (m_id > 0)
{
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC_);
xt.sec += 3;
boost::thread::sleep(xt);
}
diff -rc boost_1_44_0/libs/thread/example/tennis.cpp boost_1_44_0-new/libs/thread/example/tennis.cpp
*** boost_1_44_0/libs/thread/example/tennis.cpp 2009-10-19 11:18:13.000000000 +0200
--- boost_1_44_0-new/libs/thread/example/tennis.cpp 2013-04-12 14:00:19.412652499 +0200
***************
*** 104,110 ****
boost::thread thrdb(thread_adapter(&player, (void*)PLAYER_B));
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC);
xt.sec += 1;
boost::thread::sleep(xt);
{
--- 104,110 ----
boost::thread thrdb(thread_adapter(&player, (void*)PLAYER_B));
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC_);
xt.sec += 1;
boost::thread::sleep(xt);
{
diff -rc boost_1_44_0/libs/thread/example/thread.cpp boost_1_44_0-new/libs/thread/example/thread.cpp
*** boost_1_44_0/libs/thread/example/thread.cpp 2006-09-14 23:51:01.000000000 +0200
--- boost_1_44_0-new/libs/thread/example/thread.cpp 2013-04-12 14:00:19.414652515 +0200
***************
*** 14,20 ****
void operator()()
{
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC);
xt.sec += m_secs;
boost::thread::sleep(xt);
--- 14,20 ----
void operator()()
{
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC_);
xt.sec += m_secs;
boost::thread::sleep(xt);
diff -rc boost_1_44_0/libs/thread/example/xtime.cpp boost_1_44_0-new/libs/thread/example/xtime.cpp
*** boost_1_44_0/libs/thread/example/xtime.cpp 2006-09-14 23:51:01.000000000 +0200
--- boost_1_44_0-new/libs/thread/example/xtime.cpp 2013-04-12 14:00:19.413652507 +0200
***************
*** 10,16 ****
int main(int argc, char* argv[])
{
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC);
xt.sec += 1;
boost::thread::sleep(xt); // Sleep for 1 second
}
--- 10,16 ----
int main(int argc, char* argv[])
{
boost::xtime xt;
! boost::xtime_get(&xt, boost::TIME_UTC_);
xt.sec += 1;
boost::thread::sleep(xt); // Sleep for 1 second
}
diff -rc boost_1_44_0/libs/thread/src/pthread/thread.cpp boost_1_44_0-new/libs/thread/src/pthread/thread.cpp
*** boost_1_44_0/libs/thread/src/pthread/thread.cpp 2010-07-09 21:13:09.000000000 +0200
--- boost_1_44_0-new/libs/thread/src/pthread/thread.cpp 2013-04-12 14:00:19.415652523 +0200
***************
*** 350,356 ****
cond.timed_wait(lock, xt);
# endif
xtime cur;
! xtime_get(&cur, TIME_UTC);
if (xtime_cmp(xt, cur) <= 0)
return;
}
--- 350,356 ----
cond.timed_wait(lock, xt);
# endif
xtime cur;
! xtime_get(&cur, TIME_UTC_);
if (xtime_cmp(xt, cur) <= 0)
return;
}
***************
*** 365,371 ****
BOOST_VERIFY(!pthread_yield());
# else
xtime xt;
! xtime_get(&xt, TIME_UTC);
sleep(xt);
# endif
}
--- 365,371 ----
BOOST_VERIFY(!pthread_yield());
# else
xtime xt;
! xtime_get(&xt, TIME_UTC_);
sleep(xt);
# endif
}
diff -rc boost_1_44_0/libs/thread/src/pthread/timeconv.inl boost_1_44_0-new/libs/thread/src/pthread/timeconv.inl
*** boost_1_44_0/libs/thread/src/pthread/timeconv.inl 2010-04-01 17:04:15.000000000 +0200
--- boost_1_44_0-new/libs/thread/src/pthread/timeconv.inl 2013-04-12 14:00:19.414652515 +0200
***************
*** 20,27 ****
inline void to_time(int milliseconds, boost::xtime& xt)
{
int res = 0;
! res = boost::xtime_get(&xt, boost::TIME_UTC);
! BOOST_ASSERT(res == boost::TIME_UTC);
xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
--- 20,27 ----
inline void to_time(int milliseconds, boost::xtime& xt)
{
int res = 0;
! res = boost::xtime_get(&xt, boost::TIME_UTC_);
! BOOST_ASSERT(res == boost::TIME_UTC_);
xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
***************
*** 57,64 ****
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC);
! BOOST_ASSERT(res == boost::TIME_UTC);
if (boost::xtime_cmp(xt, cur) <= 0)
{
--- 57,64 ----
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC_);
! BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
{
***************
*** 88,95 ****
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC);
! BOOST_ASSERT(res == boost::TIME_UTC);
if (boost::xtime_cmp(xt, cur) <= 0)
milliseconds = 0;
--- 88,95 ----
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC_);
! BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
milliseconds = 0;
***************
*** 110,117 ****
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC);
! BOOST_ASSERT(res == boost::TIME_UTC);
if (boost::xtime_cmp(xt, cur) <= 0)
microseconds = 0;
--- 110,117 ----
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC_);
! BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
microseconds = 0;
diff -rc boost_1_44_0/libs/thread/src/win32/timeconv.inl boost_1_44_0-new/libs/thread/src/win32/timeconv.inl
*** boost_1_44_0/libs/thread/src/win32/timeconv.inl 2007-11-25 19:38:02.000000000 +0100
--- boost_1_44_0-new/libs/thread/src/win32/timeconv.inl 2013-04-12 14:00:19.416652531 +0200
***************
*** 17,24 ****
inline void to_time(int milliseconds, boost::xtime& xt)
{
int res = 0;
! res = boost::xtime_get(&xt, boost::TIME_UTC);
! assert(res == boost::TIME_UTC);
xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
--- 17,24 ----
inline void to_time(int milliseconds, boost::xtime& xt)
{
int res = 0;
! res = boost::xtime_get(&xt, boost::TIME_UTC_);
! assert(res == boost::TIME_UTC_);
xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
***************
*** 54,61 ****
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC);
! assert(res == boost::TIME_UTC);
if (boost::xtime_cmp(xt, cur) <= 0)
{
--- 54,61 ----
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC_);
! assert(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
{
***************
*** 85,92 ****
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC);
! assert(res == boost::TIME_UTC);
if (boost::xtime_cmp(xt, cur) <= 0)
milliseconds = 0;
--- 85,92 ----
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC_);
! assert(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
milliseconds = 0;
***************
*** 107,114 ****
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC);
! assert(res == boost::TIME_UTC);
if (boost::xtime_cmp(xt, cur) <= 0)
microseconds = 0;
--- 107,114 ----
{
boost::xtime cur;
int res = 0;
! res = boost::xtime_get(&cur, boost::TIME_UTC_);
! assert(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
microseconds = 0;
diff -rc boost_1_44_0/libs/thread/test/test_xtime.cpp boost_1_44_0-new/libs/thread/test/test_xtime.cpp
*** boost_1_44_0/libs/thread/test/test_xtime.cpp 2008-07-08 09:44:55.000000000 +0200
--- boost_1_44_0-new/libs/thread/test/test_xtime.cpp 2013-04-12 14:00:19.432652657 +0200
***************
*** 17,24 ****
{
boost::xtime xt1, xt2, cur;
BOOST_CHECK_EQUAL(
! boost::xtime_get(&cur, boost::TIME_UTC),
! static_cast<int>(boost::TIME_UTC));
xt1 = xt2 = cur;
xt1.nsec -= 1;
--- 17,24 ----
{
boost::xtime xt1, xt2, cur;
BOOST_CHECK_EQUAL(
! boost::xtime_get(&cur, boost::TIME_UTC_),
! static_cast<int>(boost::TIME_UTC_));
xt1 = xt2 = cur;
xt1.nsec -= 1;
***************
*** 42,55 ****
boost::xtime orig, cur, old;
BOOST_CHECK_EQUAL(
boost::xtime_get(&orig,
! boost::TIME_UTC), static_cast<int>(boost::TIME_UTC));
old = orig;
for (int x=0; x < 100; ++x)
{
BOOST_CHECK_EQUAL(
! boost::xtime_get(&cur, boost::TIME_UTC),
! static_cast<int>(boost::TIME_UTC));
BOOST_CHECK(boost::xtime_cmp(cur, orig) >= 0);
BOOST_CHECK(boost::xtime_cmp(cur, old) >= 0);
old = cur;
--- 42,55 ----
boost::xtime orig, cur, old;
BOOST_CHECK_EQUAL(
boost::xtime_get(&orig,
! boost::TIME_UTC_), static_cast<int>(boost::TIME_UTC));
old = orig;
for (int x=0; x < 100; ++x)
{
BOOST_CHECK_EQUAL(
! boost::xtime_get(&cur, boost::TIME_UTC_),
! static_cast<int>(boost::TIME_UTC_));
BOOST_CHECK(boost::xtime_cmp(cur, orig) >= 0);
BOOST_CHECK(boost::xtime_cmp(cur, old) >= 0);
old = cur;
diff -rc boost_1_44_0/libs/thread/test/util.inl boost_1_44_0-new/libs/thread/test/util.inl
*** boost_1_44_0/libs/thread/test/util.inl 2008-11-03 23:29:39.000000000 +0100
--- boost_1_44_0-new/libs/thread/test/util.inl 2013-04-12 14:00:19.433652665 +0200
***************
*** 28,35 ****
const int NANOSECONDS_PER_MILLISECOND = 1000000;
boost::xtime xt;
! if (boost::TIME_UTC != boost::xtime_get (&xt, boost::TIME_UTC))
! BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC");
nsecs += xt.nsec;
msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
--- 28,35 ----
const int NANOSECONDS_PER_MILLISECOND = 1000000;
boost::xtime xt;
! if (boost::TIME_UTC_ != boost::xtime_get (&xt, boost::TIME_UTC))
! BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC_");
nsecs += xt.nsec;
msecs += nsecs / NANOSECONDS_PER_MILLISECOND;