aldebaran / libqi

NAOqi core framework
http://doc.aldebaran.com/libqi/
BSD 3-Clause "New" or "Revised" License
66 stars 53 forks source link

Fix compilation with boost 1.58 #15

Closed severin-lemaignan closed 5 years ago

severin-lemaignan commented 8 years ago

This allows to compile libqi on Ubuntu 16.04.

Two issues:

1.58 introduces strict type checking in boost::get(). Use relaxed_get() to get the old behavior. relaxed_get() didn't exist in older versions of Boost, so the code must check BOOST_VERSION.

Closes #14

alkino commented 8 years ago

Your patch has been put in our internal code review system. We keep you informed on this subject ;)

Klaim commented 8 years ago

Thanks for the patch. We only need one change: factorize this code which is copy-pasted in the current version:

#if BOOST_VERSION < 105800
  const Message& msg = boost::get<const Message&>(data);
#else
  const Message& msg = boost::relaxed_get<const Message&>(data);
#endif

Suggestion: use an inline free function defined in one header, like this:

const Message& getMessage(TransportSocket::SocketEventData& data) // or template if data changes type
{
#if BOOST_VERSION < 105800
  return boost::get<const Message&>(data);
#else
  return boost::relaxed_get<const Message&>(data);
#endif
}

then use it const Message& msg = getMessage(data);

suryaambrose commented 7 years ago

Any news on this ? :)

Klaim commented 6 years ago

@suryaambrose The current master and team/platform/dev branches work with Boost 1.59 and Boost 1.64, all issues we spotted were fixed. Do you still have issues?

ngargaud commented 5 years ago

No answer since 1 year so we can close it