Files

56 lines
1.1 KiB
C++

/**
* @file include/ActivMiddleware/CxxYZ/chrono.h
*
* @brief Header file for easing C++11 (or later) <chrono> features across compilers.
*/
#if (!defined ACTIV_CXXYX_CHRONO_H)
#define ACTIV_CXXYX_CHRONO_H
#include "ActivMiddleware/ActivMiddleware.h"
// Make chrono available in Activ::CxxYZ.
// Until vc140 duration::operator% returns the incorrect type.
// vc140 std::thread is somewhat broken with optimized static builds.
#if (defined ACTIV_BOOST_NO_CXX11_HDR_CHRONO) || \
ACTIV_IS_COMPILER_VERSION(ACTIV_COMPILER_VISUAL_C, <=, ACTIV_MAKE_COMPILER_VERSION(14, 0)) || \
(defined __MINGW32__) || (defined __MINGW64__)
#define ACTIV_CXXYZ_CHRONO_USE_BOOST
#include ACTIV_BOOST_INCLUDE(chrono/chrono.hpp)
#define ACTIV_CXXYZ_CHRONO_NAMESPACE Boost
#else
#include <chrono>
#define ACTIV_CXXYZ_CHRONO_NAMESPACE std
#endif
//! Activ namespace.
namespace Activ
{
//! CxxYZ namespace.
namespace CxxYZ
{
//! chrono namespace.
namespace chrono
{
using namespace ACTIV_CXXYZ_CHRONO_NAMESPACE::chrono;
} // namespace chrono
} // namespace CxxYZ
} // namespace Activ
#undef ACTIV_CXXYZ_CHRONO_NAMESPACE
#endif // (!defined ACTIV_CXXYX_CHRONO_H)