[Tarantool-patches] [PATCH v9 1/4] coio: export helpers

Cyrill Gorcunov gorcunov at gmail.com
Fri Jan 10 11:25:53 MSK 2020


There is no reason to hide functions. In particular
we will use these helpers in popen code.

Part-of #4031

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/box/applier.cc  |  2 +-
 src/lib/core/coio.h | 18 +++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/box/applier.cc b/src/box/applier.cc
index ae3d281a5..ecfe0771b 100644
--- a/src/box/applier.cc
+++ b/src/box/applier.cc
@@ -1009,7 +1009,7 @@ applier_disconnect(struct applier *applier, enum applier_state state)
 		applier->writer = NULL;
 	}
 
-	coio_close(loop(), &applier->io);
+	coio_close_io(loop(), &applier->io);
 	/* Clear all unparsed input. */
 	ibuf_reinit(&applier->ibuf);
 	fiber_gc();
diff --git a/src/lib/core/coio.h b/src/lib/core/coio.h
index 6a2337689..c323955d7 100644
--- a/src/lib/core/coio.h
+++ b/src/lib/core/coio.h
@@ -32,9 +32,16 @@
  */
 #include "fiber.h"
 #include "trivia/util.h"
-#if defined(__cplusplus)
+
 #include "evio.h"
 
+#if defined(__cplusplus)
+extern "C" {
+#endif /* defined(__cplusplus) */
+
+struct sockaddr;
+struct uri;
+
 /**
  * Co-operative I/O
  * Yield the current fiber until IO is ready.
@@ -70,8 +77,12 @@ coio_accept(struct ev_io *coio, struct sockaddr *addr, socklen_t addrlen,
 void
 coio_create(struct ev_io *coio, int fd);
 
+/*
+ * Due to name conflict with coio_close in API_EXPORT
+ * we have to use coio_close_io() instead of plain coio_close().
+ */
 static inline void
-coio_close(ev_loop *loop, struct ev_io *coio)
+coio_close_io(ev_loop *loop, struct ev_io *coio)
 {
 	return evio_close(loop, coio);
 }
@@ -185,9 +196,6 @@ coio_stat_stat_timeout(ev_stat *stat, ev_tstamp delay);
 int
 coio_waitpid(pid_t pid);
 
-extern "C" {
-#endif /* defined(__cplusplus) */
-
 /** \cond public */
 
 enum {
-- 
2.20.1



More information about the Tarantool-patches mailing list