Browse files

core: Add support for Boost 1.50

They added a System as a dependency of Boost Thread. They also renamed
boost::TIME_UTC to boost::TIME_UTC_.
  • Loading branch information...
1 parent 426c2c3 commit 6f7afbc1987ba894d09242cfd110e6e1ae56871e Zack Moratto committed Jul 13, 2012
Showing with 17 additions and 1 deletion.
  1. +1 −1 configure.ac
  2. +4 −0 src/vw/Core/Settings.cc
  3. +12 −0 src/vw/Core/Thread.h
View
2 configure.ac
@@ -205,7 +205,7 @@ AX_PKG_BOOST([BOOST_PROGRAM_OPTIONS BOOST_FILESYSTEM BOOST_THREAD BOOST_GRAPH],
BOOST_REGEX,
[AX_PKG_BOOST_LIB(REGEX, [-lboost_regex], [boost/regex.hpp], [boost::regex(".*");])],
BOOST_DATETIME,
- [AX_PKG_BOOST_LIB(DATETIME, [-lboost_date_time], [boost/date_time/gregorian/gregorian_types.hpp])],
+ [AX_PKG_BOOST_LIB(DATETIME, [-lboost_date_time], [boost/date_time/gregorian/gregorian_types.hpp], [], [$PKG_BOOST_SYSTEM_LIBS])],
BOOST_THREAD,
[AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp], [boost::mutex();], [$PKG_BOOST_DATETIME_LIBS], [boost/thread/condition.hpp])],
BOOST_IOSTREAMS,
View
4 src/vw/Core/Settings.cc
@@ -67,7 +67,11 @@ void Settings::reload_config() {
// call reload_config and deadlock!
boost::xtime xt;
+#if BOOST_VERSION >= 105000
+ boost::xtime_get(&xt, boost::TIME_UTC_);
+#else
boost::xtime_get(&xt, boost::TIME_UTC);
+#endif
bool needs_reloading = false;
// Every five seconds, we attempt to open the log config file to see
View
12 src/vw/Core/Thread.h
@@ -175,7 +175,11 @@ namespace vw {
template<typename LockT>
bool timed_wait(LockT &lock, unsigned long milliseconds) {
boost::xtime xt;
+#if BOOST_VERSION >= 105000
+ boost::xtime_get(&xt, boost::TIME_UTC_);
+#else
boost::xtime_get(&xt, boost::TIME_UTC);
+#endif
while (milliseconds >= 1000) {
xt.sec++;
milliseconds -= 1000;
@@ -187,7 +191,11 @@ namespace vw {
template<typename LockT, typename Pred>
bool timed_wait(LockT &lock, unsigned long milliseconds, Pred pred) {
boost::xtime xt;
+#if BOOST_VERSION >= 105000
+ boost::xtime_get(&xt, boost::TIME_UTC_);
+#else
boost::xtime_get(&xt, boost::TIME_UTC);
+#endif
while (milliseconds >= 1000) {
xt.sec++;
milliseconds -= 1000;
@@ -269,7 +277,11 @@ namespace vw {
/// threads/processes.
static inline void sleep_ms( uint32 milliseconds ) {
boost::xtime xt;
+#if BOOST_VERSION >= 105000
+ boost::xtime_get(&xt, boost::TIME_UTC_);
+#else
boost::xtime_get(&xt, boost::TIME_UTC);
+#endif
while (milliseconds >= 1000) {
xt.sec++;
milliseconds -= 1000;

0 comments on commit 6f7afbc

Please sign in to comment.