Skip to content

Commit

Permalink
Fix build errors with recent boost libraries (>= 1.67)
Browse files Browse the repository at this point in the history
With boostorg/date_time@f9f2aaf5216c
we need to update the usage of duration.
Reference: Icinga/icinga2#6230

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
  • Loading branch information
myungjoo committed Feb 19, 2020
1 parent b2a9c0a commit b5a4739
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rostime/include/ros/impl/duration.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ namespace ros {
{
namespace bt = boost::posix_time;
#if defined(BOOST_DATE_TIME_HAS_NANOSECONDS)
return bt::seconds(sec) + bt::nanoseconds(nsec);
return bt::seconds(sec) + bt::nanoseconds(long(nsec));
#else
return bt::seconds(sec) + bt::microseconds(nsec/1000);
return bt::seconds(sec) + bt::microseconds(long(nsec/1000));
#endif
}
}
Expand Down
4 changes: 2 additions & 2 deletions rostime/include/ros/impl/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ namespace ros
{
namespace pt = boost::posix_time;
#if defined(BOOST_DATE_TIME_HAS_NANOSECONDS)
return pt::from_time_t(sec) + pt::nanoseconds(nsec);
return pt::from_time_t(sec) + pt::nanoseconds(long(nsec));
#else
return pt::from_time_t(sec) + pt::microseconds(nsec/1000);
return pt::from_time_t(sec) + pt::microseconds(long(nsec/1000));
#endif
}
}
Expand Down

0 comments on commit b5a4739

Please sign in to comment.