Skip to content

Commit

Permalink
[Gazebo9] Fixed fails for OSX: Added using namespace boost::placehold…
Browse files Browse the repository at this point in the history
…ers (gazebosim#2809)

Signed-off-by: Alejandro Hernández <ahcorde@gmail.com>

Co-authored-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Co-authored-by: Louise Poubel <louise@openrobotics.org>
Co-authored-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
4 people committed Aug 11, 2020
1 parent a42f269 commit d76d605
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions examples/stand_alone/custom_main_pkgconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ link_directories(${GAZEBO_LIBRARY_DIRS})

add_executable(custom_main custom_main.cc)
target_link_libraries(custom_main ${GAZEBO_LIBRARIES})

if(${CMAKE_VERSION} VERSION_LESS "3.13.0")
link_directories(${Boost_LIBRARY_DIRS})
else()
target_link_directories(custom_main PUBLIC ${Boost_LIBRARY_DIRS})
endif()
6 changes: 6 additions & 0 deletions gazebo/gui/model/ModelTreeWidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*
*/

#include <boost/version.hpp>

#include "gazebo/common/Events.hh"

#include "gazebo/gui/GuiEvents.hh"
Expand Down Expand Up @@ -160,6 +162,10 @@ ModelTreeWidget::ModelTreeWidget(QWidget *_parent)
this->layout()->setContentsMargins(0, 0, 0, 0);

// Connections
#if BOOST_VERSION >= 107300
using namespace boost::placeholders;
#endif

this->connections.push_back(
gui::model::Events::ConnectSaveModel(
boost::bind(&ModelTreeWidget::OnSaveModel, this, _1)));
Expand Down
6 changes: 6 additions & 0 deletions gazebo/gui/model/SchematicViewWidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*
*/

#include <boost/version.hpp>

#include <ignition/math/Color.hh>

#include "gazebo/rendering/Material.hh"
Expand Down Expand Up @@ -82,6 +84,10 @@ void SchematicViewWidget::Reset()
/////////////////////////////////////////////////
void SchematicViewWidget::Init()
{
#if BOOST_VERSION >= 107300
using namespace boost::placeholders;
#endif

this->connections.push_back(gui::model::Events::ConnectLinkInserted(
boost::bind(&SchematicViewWidget::AddNode, this, _1)));

Expand Down
5 changes: 4 additions & 1 deletion test/plugins/ForceTorqueModelRemovalTestPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*
*/

#include <functional>

#include "plugins/ForceTorqueModelRemovalTestPlugin.hh"

#include "gazebo/sensors/ForceTorqueSensor.hh"
Expand Down Expand Up @@ -53,7 +55,8 @@ void ForceTorqueModelRemovalTestPlugin::Load(sensors::SensorPtr _sensor,

// Create connection
this->updateConnection = gazebo::event::Events::ConnectWorldUpdateBegin(
boost::bind(&ForceTorqueModelRemovalTestPlugin::onUpdate, this, _1));
std::bind(&ForceTorqueModelRemovalTestPlugin::onUpdate, this,
std::placeholders::_1));
}

void ForceTorqueModelRemovalTestPlugin::onUpdate(
Expand Down

0 comments on commit d76d605

Please sign in to comment.