dev-ros/depthimage_to_laserscan: Fix build with gcc 5, bug #608474
authorAlexis Ballier <aballier@gentoo.org>
Wed, 8 Feb 2017 16:19:23 +0000 (17:19 +0100)
committerAlexis Ballier <aballier@gentoo.org>
Wed, 8 Feb 2017 16:19:23 +0000 (17:19 +0100)
Package-Manager: Portage-2.3.3, Repoman-2.3.1

dev-ros/depthimage_to_laserscan/depthimage_to_laserscan-1.0.7-r1.ebuild
dev-ros/depthimage_to_laserscan/files/isnan.patch [new file with mode: 0644]

index 18325b46052bb064ba5341cf11579a9c4397f987..69d11c294c60832c85221683c441a7a8dd7e679b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -23,3 +23,4 @@ RDEPEND="
        dev-ros/sensor_msgs[${CATKIN_MESSAGES_CXX_USEDEP}]
 "
 DEPEND="${RDEPEND}"
+PATCHES=( "${FILESDIR}/isnan.patch" )
diff --git a/dev-ros/depthimage_to_laserscan/files/isnan.patch b/dev-ros/depthimage_to_laserscan/files/isnan.patch
new file mode 100644 (file)
index 0000000..1125490
--- /dev/null
@@ -0,0 +1,13 @@
+Index: depthimage_to_laserscan-1.0.7/src/DepthImageToLaserScan.cpp
+===================================================================
+--- depthimage_to_laserscan-1.0.7.orig/src/DepthImageToLaserScan.cpp
++++ depthimage_to_laserscan-1.0.7/src/DepthImageToLaserScan.cpp
+@@ -59,7 +59,7 @@ bool DepthImageToLaserScan::use_point(co
+   
+   // Infs are preferable over NaNs (more information)
+   if(!new_finite && !old_finite){ // Both are not NaN or Inf.
+-    if(!isnan(new_value)){ // new is not NaN, so use it's +-Inf value.
++    if(!std::isnan(new_value)){ // new is not NaN, so use it's +-Inf value.
+       return true;
+     }
+     return false; // Do not replace old_value