Boost logo

Boost :

Subject: Re: [boost] [chrono] chrono/config.hpp enforces that time.h defines CLOCK_REALTIME; should it?
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2012-06-28 09:08:49


2012/6/28 Krzysztof Czainski <1czajnik_at_[hidden]>

> 2012/6/27 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>
>
> Le 27/06/12 14:31, Krzysztof Czainski a écrit :
>>
>> Hello,
>>>
>>> Suppose I want to use durations, and time_points with a user defined
>>> clock.
>>> I don't want to use any clocks provided by Boost.Chrono.
>>>
>>> My compiler provides a<time.h>, which doesn't define CLOCK_REALTIME,
>>> which
>>> chrono/config.hpp reports as an error. This prevents me from using parts
>>> of
>>> Chrono, that I believe don't depend on anything from<time.h>.
>>>
>> chrono/config.hpp contains
>>
>> # 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
>>
>> if CLOCK_REALTIME is not defined this means that we are unable to provide
>> system_clock which is mandatory. This is why there is an error.
>> Maybe this could only be included only when including system_clocks.hpp.
>> Please could you make a feature request on the Trac system?
>
>
> I don't need system_clock, while I would like to use time_point and
> duration. I will create a ticket then.
>

Ticket no. 7042.
Kris.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk