boost::TIME_UTC(_) with different boost versions

boost, c++

Solution

Change everything to `TIME_UTC_`. Then use this:

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

Problem

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?

Original source