Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost::TIME_UTC(_) with different boost versions

Tags:

c++

boost

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

However, we also build the source on some linux machines with boost 1.49 which doesn't know the boost::TIME_UTC_. Is there any suggested way to use boost 1.49 and 1.52 in parallel with TIME_UTC?

like image 532
Philipp Avatar asked Nov 30 '12 12:11

Philipp


1 Answers

Change everything to TIME_UTC_. Then use this:

#include <boost/version.hpp>
#if BOOST_VERSION < 105000
#define TIME_UTC_ TIME_UTC
#endif
like image 78
David Schwartz Avatar answered Nov 05 '22 04:11

David Schwartz