Boost C++ Libraries: Ticket #7042: Avoiding time_point and duration dependency on time.h and CLOCK_REALTIME https://svn.boost.org/trac10/ticket/7042 <p> Hello, </p> <p> The file chrono/config.hpp enforces that time.h defines CLOCK_REALTIME: </p> <pre class="wiki"># if defined( BOOST_CHRONO_POSIX_API ) # define BOOST_CHRONO_HAS_PROCESS_CLOCKS # include &lt;time.h&gt; //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 &lt;time.h&gt; does not supply CLOCK_REALTIME # endif ... # endif </pre><p> It seems that files: chrono/duration.hpp and chrono/time_point.hpp don't need to depend on &lt;time.h&gt; or CLOCK_REALTIME. If a compiler provides a &lt;time.h&gt;, which doesn't define CLOCK_REALTIME, or even doesn't provide &lt;time.h&gt;, it would be nice to still be able to use chrono/duration.hpp or chrono/time_point.hpp. </p> <p> Regards, Kris </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7042 Trac 1.4.3 1czajnik@… Thu, 28 Jun 2012 13:06:06 GMT <link>https://svn.boost.org/trac10/ticket/7042#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7042#comment:1</guid> <description> <p> As a workaround, I was able to use time_point.hpp and duration.hpp by defining CLOCK_REALTIME in my project. Of course, I am not using any clocks provided by Chrono. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 28 Jun 2012 20:44:28 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/7042 https://svn.boost.org/trac10/ticket/7042 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">7042.patch</span> </li> </ul> Ticket viboes Thu, 28 Jun 2012 20:46:15 GMT <link>https://svn.boost.org/trac10/ticket/7042#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7042#comment:2</guid> <description> <p> Please, could you tell me if the attached patch 7042.2.patch solves the issue with CLOCK_REALTIME? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 28 Jun 2012 20:49:12 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/7042 https://svn.boost.org/trac10/ticket/7042 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">7042.2.patch</span> </li> </ul> Ticket 1czajnik@… Fri, 29 Jun 2012 14:07:51 GMT <link>https://svn.boost.org/trac10/ticket/7042#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7042#comment:3</guid> <description> <p> Yes, I confirm, patch 7042.2.patch solves the issue with CLOCK_REALTIME. </p> <p> Cheers, Kris </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 05 Jul 2012 16:49:30 GMT</pubDate> <title>status, milestone changed https://svn.boost.org/trac10/ticket/7042#comment:4 https://svn.boost.org/trac10/ticket/7042#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.51.0</span> </li> </ul> Ticket viboes Sun, 08 Jul 2012 20:50:36 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7042#comment:5 https://svn.boost.org/trac10/ticket/7042#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Committed revision 79371. </p> Ticket