[Boost-bugs] [Boost C++ Libraries] #7042: Avoiding time_point and duration dependency on time.h and CLOCK_REALTIME

Subject: [Boost-bugs] [Boost C++ Libraries] #7042: Avoiding time_point and duration dependency on time.h and CLOCK_REALTIME
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-06-28 13:03:37


#7042: Avoiding time_point and duration dependency on time.h and CLOCK_REALTIME
-------------------------------------+--------------------------------------
 Reporter: 1czajnik@… | Owner: viboes
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: chrono
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 Hello,

 The file chrono/config.hpp enforces that time.h defines CLOCK_REALTIME:
 {{{
 # if defined( BOOST_CHRONO_POSIX_API )
 # define BOOST_CHRONO_HAS_PROCESS_CLOCKS
 # include <time.h> //to check for CLOCK_REALTIME and CLOCK_MONOTONIC
 and _POSIX_THREAD_CPUTIME
 # if defined(CLOCK_REALTIME)
 # if defined(CLOCK_MONOTONIC)
 # define BOOST_CHRONO_HAS_CLOCK_STEADY
 # endif
 # else
 # error <time.h> does not supply CLOCK_REALTIME
 # endif
 ...
 # endif
 }}}

 It seems that files: chrono/duration.hpp and chrono/time_point.hpp don't
 need to depend on <time.h> or CLOCK_REALTIME.
 If a compiler provides a <time.h>, which doesn't define CLOCK_REALTIME, or
 even doesn't provide <time.h>, it would be nice to still be able to use
 chrono/duration.hpp or chrono/time_point.hpp.

 Regards,
 Kris

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7042>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC