Index: c_time.hpp =================================================================== --- c_time.hpp (revision 76823) +++ c_time.hpp (working copy) @@ -57,15 +57,15 @@ static std::tm* localtime(const std::time_t* t, std::tm* result) { // localtime_r() not in namespace std??? - #if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 - std::tm tmp; - if(!localtime_r(t,&tmp)) - result = 0; - else - *result = tmp; - #else +#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 + std::tm tmp; + if(!localtime_r(t,&tmp)) + result = 0; + else + *result = tmp; +#else result = localtime_r(t, result); - #endif +#endif if (!result) boost::throw_exception(std::runtime_error("could not convert calendar time to local time")); return result; @@ -75,20 +75,20 @@ static std::tm* gmtime(const std::time_t* t, std::tm* result) { // gmtime_r() not in namespace std??? - #if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 - std::tm tmp; - if(!gmtime_r(t,&tmp)) +#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 + std::tm tmp; + if(!gmtime_r(t,&tmp)) result = 0; else - *result = tmp; - #else + *result = tmp; +#else result = gmtime_r(t, result); - #endif +#endif if (!result) boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time")); return result; } -#else // BOOST_HAS_THREADS +#else #if (defined(_MSC_VER) && (_MSC_VER >= 1400)) #pragma warning(push) // preserve warning settings @@ -116,7 +116,12 @@ #pragma warning(pop) // restore warnings to previous state #endif // _MSC_VER >= 1400 -#endif // BOOST_HAS_THREADS +#endif + + std::time_t time(std::time_t* t) + { + return std::time(t); + } }; }} // namespaces Index: date_clock_device.hpp =================================================================== --- date_clock_device.hpp (revision 76823) +++ date_clock_device.hpp (working copy) @@ -58,14 +58,12 @@ private: static ::std::tm* get_local_time(std::tm& result) { - ::std::time_t t; - ::std::time(&t); + ::std::time_t t = c_time::time(0); return c_time::localtime(&t, &result); } static ::std::tm* get_universal_time(std::tm& result) { - ::std::time_t t; - ::std::time(&t); + ::std::time_t t = c_time::time(0); return c_time::gmtime(&t, &result); } Index: time_clock.hpp =================================================================== --- time_clock.hpp (revision 76823) +++ time_clock.hpp (working copy) @@ -32,10 +32,8 @@ static time_type local_time() { - ::std::time_t t; - ::std::time(&t); + ::std::time_t t = c_time::time(0); ::std::tm curr, *curr_ptr; - //curr_ptr = ::std::localtime(&t); curr_ptr = c_time::localtime(&t, &curr); return create_time(curr_ptr); } @@ -45,10 +43,8 @@ static time_type universal_time() { - ::std::time_t t; - ::std::time(&t); + ::std::time_t t = c_time::time(0); ::std::tm curr, *curr_ptr; - //curr_ptr = ::std::gmtime(&t); curr_ptr = c_time::gmtime(&t, &curr); return create_time(curr_ptr); }