Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ACE/ace/Time_Value.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,10 @@ class ACE_Export ACE_Time_Value
time_t tv_sec;
suseconds_t tv_usec;
} tv_;
timeval ext_tv_;
// Must be mutable as the zero and max static members are const, but are modified
// in the timeval operations, having it not mutable will cause an access violation
// with some compilers as they put these in the const section.
mutable timeval ext_tv_;
#else
Comment thread
jwillemsen marked this conversation as resolved.
timeval tv_;
#endif /* ACE_HAS_TIME_T_LONG_MISMATCH */
Expand Down
10 changes: 4 additions & 6 deletions ACE/ace/Time_Value.inl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ ACE_Time_Value::operator timeval () const
// ACE_OS_TRACE ("ACE_Time_Value::operator timeval");
#if defined (ACE_HAS_TIME_T_LONG_MISMATCH)
// Recall that on some Windows we substitute another type for timeval in tv_
ACE_Time_Value *me = const_cast<ACE_Time_Value*> (this);
me->ext_tv_.tv_sec = ACE_Utils::truncate_cast<long> (this->tv_.tv_sec);
me->ext_tv_.tv_usec = ACE_Utils::truncate_cast<long> (this->tv_.tv_usec);
this->ext_tv_.tv_sec = this->tv_.tv_sec;
this->ext_tv_.tv_usec = this->tv_.tv_usec;
return this->ext_tv_;
#else
return this->tv_;
Expand Down Expand Up @@ -42,9 +41,8 @@ ACE_Time_Value::operator const timeval * () const
// ACE_OS_TRACE ("ACE_Time_Value::operator const timeval *");
#if defined (ACE_HAS_TIME_T_LONG_MISMATCH)
// Recall that on some Windows we substitute another type for timeval in tv_
ACE_Time_Value *me = const_cast<ACE_Time_Value*> (this);
me->ext_tv_.tv_sec = ACE_Utils::truncate_cast<long> (this->tv_.tv_sec);
me->ext_tv_.tv_usec = ACE_Utils::truncate_cast<long> (this->tv_.tv_usec);
this->ext_tv_.tv_sec = this->tv_.tv_sec;
this->ext_tv_.tv_usec = this->tv_.tv_usec;
return (const timeval *) &this->ext_tv_;
#else
return (const timeval *) &this->tv_;
Expand Down
1 change: 1 addition & 0 deletions ACE/ace/config-win32-borland.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define ACE_HAS_DIRENT

#define ACE_HAS_WIN32_STRUCTURED_EXCEPTIONS
#define ACE_HAS_TIME_T_LONG_MISMATCH

#define ACE_LACKS_TERMIOS_H
#define ACE_LACKS_NETINET_TCP_H
Expand Down