Opened 12 years ago

Closed 12 years ago

#4727 closed Patches (fixed)

thread_time.hpp get_system_time depends on BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK being defined

Reported by: nstewart@… Owned by: Anthony Williams
Milestone: Boost 1.45.0 Component: thread
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

Came across this issue while cross-compiling for Android.

The implementation of boost::get_system_time depends on microsec_clock<system_time>, which does not exist unless BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK is defined.

The attached patch takes a similar approach to: https://svn.boost.org/trac/boost/changeset/58704

Index: thread_time.hpp =================================================================== --- thread_time.hpp (revision 65916) +++ thread_time.hpp (working copy) @@ -6,6 +6,7 @@

accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

+#include <boost/date_time/time_clock.hpp>

#include <boost/date_time/microsec_time_clock.hpp> #include <boost/date_time/posix_time/posix_time_types.hpp>

@@ -17,7 +18,11 @@

inline system_time get_system_time() {

+#if defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)

return boost::date_time::microsec_clock<system_time>::universal_time();

+#else defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK) + return boost::date_time::second_clock<system_time>::universal_time(); +#endif defined(BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK)

}

namespace detail

Attachments (1)

boost_thread_time.patch (872 bytes ) - added by nstewart@… 12 years ago.
Diff w.r.t 65916 (Oct 11th 2010)

Download all attachments as: .zip

Change History (2)

by nstewart@…, 12 years ago

Attachment: boost_thread_time.patch added

Diff w.r.t 65916 (Oct 11th 2010)

comment:1 by Anthony Williams, 12 years ago

Resolution: fixed
Status: newclosed

Fixed on trunk, revision 66141

Note: See TracTickets for help on using tickets.