Boost :: TIME_UTC (_) with various boost versions

I just updated my project on Windows from boost 1.46 to the current increase of 1.52. We have some uses of boost::TIME_UTC , which I changed to boost::TIME_UTC_ according to https://svn.boost.org/trac/boost/ticket/6940 .

However, we also create a source on some Linux machines with boost 1.49 that boost::TIME_UTC_ does not know. Is there a suggested way to use boost 1.49 and 1.52 in parallel with TIME_UTC?

+6
source share
2 answers

Change everything to TIME_UTC_ . Then use this:

 #include <boost/version.hpp> #if BOOST_VERSION < 105000 #define TIME_UTC_ TIME_UTC #endif 
+11
source

We use:

 #include <boost/version.hpp> #if BOOST_VERSION < 105000 #include <boost/thread/xtime.hpp> namespace boost { enum xtime_compat { TIME_UTC_=TIME_UTC }; } #endif 

Thus, you can use boost::TIME_UTC_ , as in 1.50 onwards.

But not for openSuse, because they decided to merge this change back to 1.49.

+2
source

All Articles