diff -r -u boost_1_38_0/boost/date_time/c_time.hpp boost_1_38_vxworks/boost/date_time/c_time.hpp
old
|
new
|
|
55 | 55 | static std::tm* localtime(const std::time_t* t, std::tm* result) |
56 | 56 | { |
57 | 57 | // localtime_r() not in namespace std??? |
58 | | result = localtime_r(t, result); |
| 58 | #if !defined(BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS_NO_RETVAL) |
| 59 | result = |
| 60 | #endif |
| 61 | localtime_r(t, result); |
59 | 62 | if (!result) |
60 | 63 | boost::throw_exception(std::runtime_error("could not convert calendar time to local time")); |
61 | 64 | return result; |
… |
… |
|
65 | 68 | static std::tm* gmtime(const std::time_t* t, std::tm* result) |
66 | 69 | { |
67 | 70 | // gmtime_r() not in namespace std??? |
68 | | result = gmtime_r(t, result); |
| 71 | #if !defined(BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS_NO_RETVAL) |
| 72 | result = |
| 73 | #endif |
| 74 | gmtime_r(t, result); |
69 | 75 | if (!result) |
70 | 76 | boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time")); |
71 | 77 | return result; |
diff -r -u boost_1_38_0/boost/date_time/compiler_config.hpp boost_1_38_vxworks/boost/date_time/compiler_config.hpp
old
|
new
|
|
32 | 32 | |
33 | 33 | //Set up a configuration parameter for platforms that have |
34 | 34 | //GetTimeOfDay |
35 | | #if defined(BOOST_HAS_GETTIMEOFDAY) || defined(BOOST_HAS_FTIME) |
| 35 | #if defined(BOOST_HAS_GETTIMEOFDAY) || defined(BOOST_HAS_FTIME) || defined(BOOST_HAS_CLOCK_GETTIME) |
36 | 36 | #define BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK |
37 | 37 | #endif |
38 | 38 | |
… |
… |
|
164 | 164 | //no reentrant posix functions (eg: localtime_r) |
165 | 165 | # elif (!defined(__hpux) || (defined(__hpux) && defined(_REENTRANT))) |
166 | 166 | # define BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS |
| 167 | # if defined(__VXWORKS__) |
| 168 | // vxworks has strange versions of localtime_r and gmtime_r |
| 169 | # define BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS_NO_RETVAL |
| 170 | # endif |
167 | 171 | # endif |
168 | 172 | #endif |
169 | 173 | |
diff -r -u boost_1_38_0/boost/date_time/microsec_time_clock.hpp boost_1_38_vxworks/boost/date_time/microsec_time_clock.hpp
old
|
new
|
|
84 | 84 | gettimeofday(&tv, 0); //gettimeofday does not support TZ adjust on Linux. |
85 | 85 | std::time_t t = tv.tv_sec; |
86 | 86 | boost::uint32_t sub_sec = tv.tv_usec; |
| 87 | #elif defined(BOOST_HAS_CLOCK_GETTIME) |
| 88 | timespec ts; |
| 89 | clock_gettime(CLOCK_REALTIME, &ts); |
| 90 | std::time_t t = ts.tv_sec; |
| 91 | boost::uint32_t sub_sec = ts.tv_nsec/1000; |
87 | 92 | #elif defined(BOOST_HAS_FTIME) |
88 | 93 | winapi::file_time ft; |
89 | 94 | winapi::get_system_time_as_file_time(ft); |