diff --git a/dds/DCPS/TimePoint_T.inl b/dds/DCPS/TimePoint_T.inl index 693c054fcbb..176a9e4cd53 100644 --- a/dds/DCPS/TimePoint_T.inl +++ b/dds/DCPS/TimePoint_T.inl @@ -88,7 +88,9 @@ ACE_INLINE IdlType TimePoint_T::to_idl_struct() const { - return time_value_to_time(value_); + IdlType i; + time_value_to_time(i, value_); + return i; } template diff --git a/dds/DCPS/Time_Helper.h b/dds/DCPS/Time_Helper.h index 170282fcc26..07874ae5434 100644 --- a/dds/DCPS/Time_Helper.h +++ b/dds/DCPS/Time_Helper.h @@ -31,6 +31,13 @@ ACE_Time_Value time_to_time_value(const TimeT& t) return tv; } +template +void time_value_to_time(IdlType& t, const ACE_Time_Value& tv) +{ + t.sec = ACE_Utils::truncate_cast(tv.sec()); + t.nanosec = ACE_Utils::truncate_cast(tv.usec() * 1000); +} + ACE_INLINE OpenDDS_Dcps_Export DDS::Time_t time_value_to_time(const ACE_Time_Value& tv);