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: | 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
Diff w.r.t 65916 (Oct 11th 2010)