diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2006-03-22 22:43:06 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2006-03-22 22:43:06 +0000 |
commit | cc0c47c8c419cbf918f1f4ddf1d30c8238000a66 (patch) | |
tree | 99c0fccb25e68f8052a6884017fd58caf223ea35 /ace | |
parent | 570b2a8f9da68978bd837b14c988894f1b155d7d (diff) | |
download | ATCD-cc0c47c8c419cbf918f1f4ddf1d30c8238000a66.tar.gz |
ChangeLogTag:Wed Mar 22 18:26:36 UTC 2006 Ossama Othman <ossama_othman at symantec dot com>
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Time_Value.inl | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/ace/Time_Value.inl b/ace/Time_Value.inl index 231501ea222..6967566b368 100644 --- a/ace/Time_Value.inl +++ b/ace/Time_Value.inl @@ -52,7 +52,8 @@ ACE_INLINE void ACE_Time_Value::set (time_t sec, suseconds_t usec) { // ACE_OS_TRACE ("ACE_Time_Value::set"); -#if defined (ACE_WIN64) +#if defined (ACE_WIN64) \ + || (defined (ACE_WIN32) && !defined (_USE_32BIT_TIME_T)) // Win64 uses 'long' (32 bit) timeval and 64-bit time_t, so we have // to get these back in range. if (sec > LONG_MAX) @@ -92,11 +93,9 @@ ACE_INLINE void ACE_Time_Value::set (const timespec_t &tv) { // ACE_OS_TRACE ("ACE_Time_Value::set"); - this->tv_.tv_sec = tv.tv_sec; - // Convert nanoseconds into microseconds. - this->tv_.tv_usec = tv.tv_nsec / 1000; - this->normalize (); + this->set (tv.sec, + tv.tv_nsec / 1000); // Convert nanoseconds into microseconds. } ACE_INLINE @@ -129,7 +128,19 @@ ACE_INLINE void ACE_Time_Value::sec (time_t sec) { // ACE_OS_TRACE ("ACE_Time_Value::sec"); +#if defined (ACE_WIN64) \ + || (defined (ACE_WIN32) && !defined (_USE_32BIT_TIME_T)) + // Win64 uses 'long' (32 bit) timeval and 64-bit time_t, so we have + // to get these back in range. + if (sec > LONG_MAX) + this->tv_.tv_sec = LONG_MAX; + else if (sec < LONG_MIN) + this->tv_.tv_sec = LONG_MIN; + else + this->tv_.tv_sec = static_cast<long> (sec); +#else this->tv_.tv_sec = sec; +#endif } // Converts from Time_Value format into milli-seconds format. |