roscpp: add missing header for writev()

resolves #532

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
This commit is contained in:
Dmitry Rozhkov 2017-07-20 09:42:41 +03:00
parent 842830395a
commit 000032396c
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,39 @@
From 4fbb9f952726a12b1938ea7af9e88ae8b234395e Mon Sep 17 00:00:00 2001
From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Date: Wed, 19 Jul 2017 11:17:11 +0300
Subject: [PATCH] [roscpp] add missing header for writev().
After an update of gcc and glibc roscpp started to fail builds with the error:
/home/rojkov/work/ros/build/tmp-glibc/work/i586-oe-linux/roscpp/1.11.21-r0/ros_comm-1.11.21/clients/roscpp/src/libros/transport/transport_udp.cpp:579:25: error: 'writev' was not declared in this scope
ssize_t num_bytes = writev(sock_, iov, 2);
^~~~~~
According to POSIX.1-2001 the function writev() is declared in sys/uio.h.
The patch includes the missing header for POSIX compliant systems.
Upstream-Status: Accepted [https://github.com/ros/ros_comm/pull/1105]
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
clients/roscpp/src/libros/transport/transport_udp.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/clients/roscpp/src/libros/transport/transport_udp.cpp b/clients/roscpp/src/libros/transport/transport_udp.cpp
index c7d8298..47d969e 100644
--- a/clients/roscpp/src/libros/transport/transport_udp.cpp
+++ b/clients/roscpp/src/libros/transport/transport_udp.cpp
@@ -48,6 +48,9 @@
#elif defined(__ANDROID__)
// For readv() and writev() on ANDROID
#include <sys/uio.h>
+#elif defined(_POSIX_VERSION)
+ // For readv() and writev()
+ #include <sys/uio.h>
#endif
namespace ros
--
2.9.3

View File

@ -10,6 +10,8 @@ DEPENDS = "cpp-common message-generation rosconsole roscpp-serialization roscpp-
require ros-comm.inc require ros-comm.inc
SRC_URI += "file://0001-roscpp-add-missing-header-for-writev.patch;striplevel=3"
ROS_PKG_SUBDIR = "clients" ROS_PKG_SUBDIR = "clients"
CXXFLAGS_append = " -I${OECMAKE_BUILDPATH}/devel/include" CXXFLAGS_append = " -I${OECMAKE_BUILDPATH}/devel/include"