• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision0de3e723bbe29a5e4818053c35af8f6fdef503a4 (tree)
Zeit2013-06-10 16:49:51
AutorHiroaki Nakano <nakano.hiroaki@nttc...>
CommiterHiroaki Nakano

Log Message

#31545: boost 1.50 以上でビルドできない

事象

boost 1.50 以上を用いてビルドしようとすると,boost::TIME_UTC が未定義である旨のエラーが発生し,ビルドできない.

原因

C11 で TIME_UTC が入って名前がかぶったため,boost 側が名前を変更(TIME_UTC → TIME_UTC_)した.
https://svn.boost.org/trac/boost/ticket/6940

対処

boost 1.50 以上(BOOST_VERSION > 105000)の場合は boost::TIME_UTC_ を使うようにする.
(boost 1.49 以下は boost::TIME_UTC のまま.TIME_UTC_ は未定義)

Signed-off-by: Shinya TAKEBAYASHI <takebayashi.shinya@nttcom.co.jp>
Reviewed-by: Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp>

Ändern Zusammenfassung

Diff

--- a/l7vsd/src/l7vsadm.cpp
+++ b/l7vsd/src/l7vsadm.cpp
@@ -3002,7 +3002,12 @@ bool l7vs::l7vsadm::execute(int argc, char *argv[])
30023002
30033003 // Lock retrying.
30043004 boost::xtime xt;
3005+#if BOOST_VERSION >= 105000
3006+ xtime_get(&xt, boost::TIME_UTC_);
3007+#else
30053008 xtime_get(&xt, boost::TIME_UTC);
3009+#endif
3010+
30063011 xt.sec += command_wait_interval;
30073012 boost::thread::sleep(xt);
30083013 }
--- a/l7vsd/src/session_thread_control.cpp
+++ b/l7vsd/src/session_thread_control.cpp
@@ -103,7 +103,12 @@ void session_thread_control::upstream_run()
103103 if (state == WAIT) { // after create or session end. this thread is pooling mode
104104 boost::mutex::scoped_lock lock(upthread_condition_mutex);
105105 boost::xtime wait;
106+#if BOOST_VERSION >= 105000
107+ boost::xtime_get(&wait, boost::TIME_UTC_);
108+#else
106109 boost::xtime_get(&wait, boost::TIME_UTC);
110+#endif
111+
107112 wait.sec += 1;
108113 upthread_running_mutex.unlock();
109114 upthread_condition.timed_wait(lock, wait); // thread is condition wait( start at notify_all() )
@@ -166,7 +171,12 @@ void session_thread_control::downstream_run()
166171 boost::mutex::scoped_lock lock(downthread_condition_mutex);
167172 // downthread_condition.wait( lock ); // thread is condition wait( start at notify_all() )
168173 boost::xtime wait;
174+#if BOOST_VERSION >= 105000
175+ boost::xtime_get(&wait, boost::TIME_UTC_);
176+#else
169177 boost::xtime_get(&wait, boost::TIME_UTC);
178+#endif
179+
170180 wait.sec += 1;
171181 downthread_running_mutex.unlock();
172182 downthread_condition.timed_wait(lock, wait); // thread is condition wait( start at notify_all() )
--- a/l7vsd/src/tcp_session.cpp
+++ b/l7vsd/src/tcp_session.cpp
@@ -813,7 +813,12 @@ void tcp_session::up_thread_run()
813813 } //message alive end.
814814 if (ssl_flag && up_thread_next_call_function.first == UP_FUNC_CLIENT_ACCEPT_EVENT) { //handshake timeout check
815815 boost::xtime now_time;
816+#if BOOST_VERSION >= 105000
817+ boost::xtime_get(&now_time, boost::TIME_UTC_);
818+#else
816819 boost::xtime_get(&now_time, boost::TIME_UTC);
820+#endif
821+
817822 if ((now_time.sec - start_handshake_time.sec) > ssl_handshake_time_out) { // timeout detect.
818823 boost::system::error_code error_code;
819824 client_ssl_socket.close(error_code);
@@ -1101,7 +1106,12 @@ void tcp_session::up_thread_client_accept(const TCP_PROCESS_TYPE_TAG process_typ
11011106 if (ssl_flag) {
11021107 upthread_status = UPTHREAD_LOCK;
11031108 // try ssl handshake
1109+#if BOOST_VERSION >= 105000
1110+ boost::xtime_get(&start_handshake_time, boost::TIME_UTC_);
1111+#else
11041112 boost::xtime_get(&start_handshake_time, boost::TIME_UTC);
1113+#endif
1114+
11051115 client_ssl_socket.setoption(error_code);
11061116 client_ssl_socket.async_handshake(boost::bind(&tcp_session::up_thread_client_handshake_handle,
11071117 this,
@@ -4140,7 +4150,12 @@ void tcp_session::down_thread_sorryserver_handle_async_read_some(tcp_session::TC
41404150 //! milliseconds to boost::xtime converter
41414151 void tcp_session::to_time(int in, boost::xtime &xt)
41424152 {
4153+#if BOOST_VERSION >= 105000
4154+ boost::xtime_get(&xt, boost::TIME_UTC_);
4155+#else
41434156 boost::xtime_get(&xt, boost::TIME_UTC);
4157+#endif
4158+
41444159 xt.sec += (in / 1000);
41454160 xt.nsec += (in % 1000) * 1000000;
41464161 if (xt.nsec >= 1000000000) {