From 7bb5930ecf79b19aebf916cb28490777afa367ce Mon Sep 17 00:00:00 2001
From: Miklos Espak <espakm@gmail.com>
Date: Fri, 8 Mar 2013 14:15:31 +0000
Subject: [PATCH] Fix for g++ 4.7 compatibility

---
 boost/thread/xtime.hpp                             |    4 ++--
 libs/interprocess/test/condition_test_template.hpp |    4 ++--
 libs/interprocess/test/util.hpp                    |    2 +-
 libs/spirit/classic/test/grammar_mt_tests.cpp      |    2 +-
 libs/spirit/classic/test/owi_mt_tests.cpp          |    4 ++--
 libs/thread/example/starvephil.cpp                 |    6 +++---
 libs/thread/example/tennis.cpp                     |    2 +-
 libs/thread/example/thread.cpp                     |    2 +-
 libs/thread/example/xtime.cpp                      |    2 +-
 libs/thread/src/pthread/thread.cpp                 |    4 ++--
 libs/thread/src/pthread/timeconv.inl               |   16 ++++++++--------
 libs/thread/src/win32/timeconv.inl                 |   16 ++++++++--------
 libs/thread/test/test_xtime.cpp                    |   10 +++++-----
 libs/thread/test/util.inl                          |    4 ++--
 14 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/boost/thread/xtime.hpp b/boost/thread/xtime.hpp
index 7cc6272..af00bb8 100644
--- a/boost/thread/xtime.hpp
+++ b/boost/thread/xtime.hpp
@@ -20,7 +20,7 @@ namespace boost {
 
 enum xtime_clock_types
 {
-    TIME_UTC=1
+    TIME_UTC_=1
 //    TIME_TAI,
 //    TIME_MONOTONIC,
 //    TIME_PROCESS,
@@ -68,7 +68,7 @@ inline xtime get_xtime(boost::system_time const& abs_time)
 
 inline int xtime_get(struct xtime* xtp, int clock_type)
 {
-    if (clock_type == TIME_UTC)
+    if (clock_type == boost::TIME_UTC_)
     {
         *xtp=get_xtime(get_system_time());
         return clock_type;
diff --git a/libs/interprocess/test/condition_test_template.hpp b/libs/interprocess/test/condition_test_template.hpp
index ced4aa5..0dc6f8c 100644
--- a/libs/interprocess/test/condition_test_template.hpp
+++ b/libs/interprocess/test/condition_test_template.hpp
@@ -49,8 +49,8 @@ inline boost::xtime delay(int secs, int msecs=0, int nsecs=0)
     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;
+    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 --git a/libs/interprocess/test/util.hpp b/libs/interprocess/test/util.hpp
index 29400b9..dc92d12 100644
--- a/libs/interprocess/test/util.hpp
+++ b/libs/interprocess/test/util.hpp
@@ -71,7 +71,7 @@ inline bool in_range(const boost::posix_time::ptime& xt, int secs=1)
 boost::xtime xsecs(int secs)
 {
    boost::xtime ret;
-   boost::xtime_get(&ret, boost::TIME_UTC);
+   boost::xtime_get(&ret, boost::TIME_UTC_);
    ret.sec += secs;
    return ret;
 }
diff --git a/libs/spirit/classic/test/grammar_mt_tests.cpp b/libs/spirit/classic/test/grammar_mt_tests.cpp
index 16bd94e..bcbb1bf 100644
--- a/libs/spirit/classic/test/grammar_mt_tests.cpp
+++ b/libs/spirit/classic/test/grammar_mt_tests.cpp
@@ -70,7 +70,7 @@ milli_sleep(unsigned long milliseconds)
 {
     static long const nanoseconds_per_second = 1000L*1000L*1000L;
     boost::xtime xt;
-    boost::xtime_get(&xt, boost::TIME_UTC);
+    boost::xtime_get(&xt, boost::TIME_UTC_);
     xt.nsec+=1000*1000*milliseconds;
     while (xt.nsec > nanoseconds_per_second)
     {
diff --git a/libs/spirit/classic/test/owi_mt_tests.cpp b/libs/spirit/classic/test/owi_mt_tests.cpp
index 301b826..3875f77 100644
--- a/libs/spirit/classic/test/owi_mt_tests.cpp
+++ b/libs/spirit/classic/test/owi_mt_tests.cpp
@@ -86,7 +86,7 @@ struct test_task
             return test_size;
 
         boost::xtime now;
-        boost::xtime_get(&now, boost::TIME_UTC);
+        boost::xtime_get(&now, boost::TIME_UTC_);
         unsigned long seconds = now.sec - start_time.sec;
         if (seconds < 4)
         {
@@ -187,7 +187,7 @@ check_not_contained_in(
 void concurrent_creation_of_objects()
 {
     {
-        boost::xtime_get(&start_time, boost::TIME_UTC);
+        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 --git a/libs/thread/example/starvephil.cpp b/libs/thread/example/starvephil.cpp
index 0ef2e0d..b37c503 100644
--- a/libs/thread/example/starvephil.cpp
+++ b/libs/thread/example/starvephil.cpp
@@ -50,7 +50,7 @@ public:
                       << "very hot ..." << std::endl;
         }
         boost::xtime xt;
-        boost::xtime_get(&xt, boost::TIME_UTC);
+        boost::xtime_get(&xt, boost::TIME_UTC_);
         xt.sec += 3;
         boost::thread::sleep(xt);
         m_chickens += value;
@@ -85,7 +85,7 @@ void chef()
             std::cout << "(" << clock() << ") Chef: cooking ..." << std::endl;
         }
         boost::xtime xt;
-        boost::xtime_get(&xt, boost::TIME_UTC);
+        boost::xtime_get(&xt, boost::TIME_UTC_);
         xt.sec += 2;
         boost::thread::sleep(xt);
         {
@@ -111,7 +111,7 @@ struct phil
             if (m_id > 0)
             {
                 boost::xtime xt;
-                boost::xtime_get(&xt, boost::TIME_UTC);
+                boost::xtime_get(&xt, boost::TIME_UTC_);
                 xt.sec += 3;
                 boost::thread::sleep(xt);
             }
diff --git a/libs/thread/example/tennis.cpp b/libs/thread/example/tennis.cpp
index 798f55e..621d089 100644
--- a/libs/thread/example/tennis.cpp
+++ b/libs/thread/example/tennis.cpp
@@ -104,7 +104,7 @@ int main(int argc, char* argv[])
     boost::thread thrdb(thread_adapter(&player, (void*)PLAYER_B));
 
     boost::xtime xt;
-    boost::xtime_get(&xt, boost::TIME_UTC);
+    boost::xtime_get(&xt, boost::TIME_UTC_);
     xt.sec += 1;
     boost::thread::sleep(xt);
     {
diff --git a/libs/thread/example/thread.cpp b/libs/thread/example/thread.cpp
index c21a3b5..09aa05a 100644
--- a/libs/thread/example/thread.cpp
+++ b/libs/thread/example/thread.cpp
@@ -14,7 +14,7 @@ struct thread_alarm
     void operator()()
     {
         boost::xtime xt;
-        boost::xtime_get(&xt, boost::TIME_UTC);
+        boost::xtime_get(&xt, boost::TIME_UTC_);
         xt.sec += m_secs;
 
         boost::thread::sleep(xt);
diff --git a/libs/thread/example/xtime.cpp b/libs/thread/example/xtime.cpp
index a9b1933..0c4fb71 100644
--- a/libs/thread/example/xtime.cpp
+++ b/libs/thread/example/xtime.cpp
@@ -10,7 +10,7 @@
 int main(int argc, char* argv[])
 {
     boost::xtime xt;
-    boost::xtime_get(&xt, boost::TIME_UTC);
+    boost::xtime_get(&xt, boost::TIME_UTC_);
     xt.sec += 1;
     boost::thread::sleep(xt); // Sleep for 1 second
 }
diff --git a/libs/thread/src/pthread/thread.cpp b/libs/thread/src/pthread/thread.cpp
index 187c024..45acc56 100644
--- a/libs/thread/src/pthread/thread.cpp
+++ b/libs/thread/src/pthread/thread.cpp
@@ -350,7 +350,7 @@ namespace boost
                     cond.timed_wait(lock, xt);
 #   endif
                     xtime cur;
-                    xtime_get(&cur, TIME_UTC);
+                    xtime_get(&cur, boost::TIME_UTC_);
                     if (xtime_cmp(xt, cur) <= 0)
                         return;
                 }
@@ -365,7 +365,7 @@ namespace boost
             BOOST_VERIFY(!pthread_yield());
 #   else
             xtime xt;
-            xtime_get(&xt, TIME_UTC);
+            xtime_get(&xt, boost::TIME_UTC_);
             sleep(xt);
 #   endif
         }
diff --git a/libs/thread/src/pthread/timeconv.inl b/libs/thread/src/pthread/timeconv.inl
index b75a135..7c07802 100644
--- a/libs/thread/src/pthread/timeconv.inl
+++ b/libs/thread/src/pthread/timeconv.inl
@@ -20,8 +20,8 @@ const int NANOSECONDS_PER_MICROSECOND = 1000;
 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);
+    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,8 +57,8 @@ inline void to_timespec_duration(const boost::xtime& xt, timespec& ts)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    BOOST_ASSERT(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    BOOST_ASSERT(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
     {
@@ -88,8 +88,8 @@ inline void to_duration(boost::xtime xt, int& milliseconds)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    BOOST_ASSERT(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    BOOST_ASSERT(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
         milliseconds = 0;
@@ -110,8 +110,8 @@ inline void to_microduration(boost::xtime xt, int& microseconds)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    BOOST_ASSERT(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    BOOST_ASSERT(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
         microseconds = 0;
diff --git a/libs/thread/src/win32/timeconv.inl b/libs/thread/src/win32/timeconv.inl
index 5ec3b17..c646783 100644
--- a/libs/thread/src/win32/timeconv.inl
+++ b/libs/thread/src/win32/timeconv.inl
@@ -17,8 +17,8 @@ const int NANOSECONDS_PER_MICROSECOND = 1000;
 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);
+    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,8 +54,8 @@ inline void to_timespec_duration(const boost::xtime& xt, timespec& ts)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    assert(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    assert(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
     {
@@ -85,8 +85,8 @@ inline void to_duration(boost::xtime xt, int& milliseconds)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    assert(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    assert(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
         milliseconds = 0;
@@ -107,8 +107,8 @@ inline void to_microduration(boost::xtime xt, int& microseconds)
 {
     boost::xtime cur;
     int res = 0;
-    res = boost::xtime_get(&cur, boost::TIME_UTC);
-    assert(res == boost::TIME_UTC);
+    res = boost::xtime_get(&cur, boost::TIME_UTC_);
+    assert(res == boost::TIME_UTC_);
 
     if (boost::xtime_cmp(xt, cur) <= 0)
         microseconds = 0;
diff --git a/libs/thread/test/test_xtime.cpp b/libs/thread/test/test_xtime.cpp
index efdfd3c..1a23cdf 100644
--- a/libs/thread/test/test_xtime.cpp
+++ b/libs/thread/test/test_xtime.cpp
@@ -17,8 +17,8 @@ void test_xtime_cmp()
 {
     boost::xtime xt1, xt2, cur;
     BOOST_CHECK_EQUAL(
-        boost::xtime_get(&cur, boost::TIME_UTC),
-        static_cast<int>(boost::TIME_UTC));
+        boost::xtime_get(&cur, boost::TIME_UTC_),
+        static_cast<int>(boost::TIME_UTC_));
 
     xt1 = xt2 = cur;
     xt1.nsec -= 1;
@@ -42,14 +42,14 @@ void test_xtime_get()
     boost::xtime orig, cur, old;
     BOOST_CHECK_EQUAL(
         boost::xtime_get(&orig,
-            boost::TIME_UTC), static_cast<int>(boost::TIME_UTC));
+            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::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 --git a/libs/thread/test/util.inl b/libs/thread/test/util.inl
index 5c761d5..4f8dcbe 100644
--- a/libs/thread/test/util.inl
+++ b/libs/thread/test/util.inl
@@ -28,8 +28,8 @@ inline boost::xtime delay(int secs, int msecs=0, int nsecs=0)
     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");
+    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;
-- 
1.7.9.6 (Apple Git-31.1)

