Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] Code cleanup: sync declarations and definitions
@ 2020-04-13 19:33 Sergey Ostanevich
  2020-04-30 12:16 ` Kirill Yukhin
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Ostanevich @ 2020-04-13 19:33 UTC (permalink / raw)
  To: tarantool-patches


API_EXPORT defines nothrow, so compiler warns or errors depending on the
build options in case function definition doesn't have the define.

Synced declarations and definitions for the functions caused build
problems.

Closes #4885

https://github.com/tarantool/tarantool/issues/4885
https://github.com/tarantool/tarantool/commit/980341a53e2a5d4ba30a21adfba5b2e045dfc078

---
 src/box/box.cc       | 28 ++++++++++++++--------------
 src/lib/core/coio.cc |  5 +++--
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/box/box.cc b/src/box/box.cc
index 0c15ba5e9..574e19f6b 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -1069,14 +1069,14 @@ boxk(int type, uint32_t space_id, const char *format, ...)
 	return box_process_rw(&request, space, NULL);
 }
 
-int
+API_EXPORT int
 box_return_tuple(box_function_ctx_t *ctx, box_tuple_t *tuple)
 {
 	return port_tuple_add(ctx->port, tuple);
 }
 
 /* schema_find_id()-like method using only public API */
-uint32_t
+API_EXPORT uint32_t
 box_space_id_by_name(const char *name, uint32_t len)
 {
 	if (len > BOX_NAME_MAX)
@@ -1101,7 +1101,7 @@ box_space_id_by_name(const char *name, uint32_t len)
 	return result;
 }
 
-uint32_t
+API_EXPORT uint32_t
 box_index_id_by_name(uint32_t space_id, const char *name, uint32_t len)
 {
 	if (len > BOX_NAME_MAX)
@@ -1143,7 +1143,7 @@ box_process1(struct request *request, box_tuple_t **result)
 	return box_process_rw(request, space, result);
 }
 
-int
+API_EXPORT int
 box_select(uint32_t space_id, uint32_t index_id,
 	   int iterator, uint32_t offset, uint32_t limit,
 	   const char *key, const char *key_end,
@@ -1218,7 +1218,7 @@ box_select(uint32_t space_id, uint32_t index_id,
 	return 0;
 }
 
-int
+API_EXPORT int
 box_insert(uint32_t space_id, const char *tuple, const char *tuple_end,
 	   box_tuple_t **result)
 {
@@ -1232,7 +1232,7 @@ box_insert(uint32_t space_id, const char *tuple, const char *tuple_end,
 	return box_process1(&request, result);
 }
 
-int
+API_EXPORT int
 box_replace(uint32_t space_id, const char *tuple, const char *tuple_end,
 	    box_tuple_t **result)
 {
@@ -1246,7 +1246,7 @@ box_replace(uint32_t space_id, const char *tuple, const char *tuple_end,
 	return box_process1(&request, result);
 }
 
-int
+API_EXPORT int
 box_delete(uint32_t space_id, uint32_t index_id, const char *key,
 	   const char *key_end, box_tuple_t **result)
 {
@@ -1261,7 +1261,7 @@ box_delete(uint32_t space_id, uint32_t index_id, const char *key,
 	return box_process1(&request, result);
 }
 
-int
+API_EXPORT int
 box_update(uint32_t space_id, uint32_t index_id, const char *key,
 	   const char *key_end, const char *ops, const char *ops_end,
 	   int index_base, box_tuple_t **result)
@@ -1282,7 +1282,7 @@ box_update(uint32_t space_id, uint32_t index_id, const char *key,
 	return box_process1(&request, result);
 }
 
-int
+API_EXPORT int
 box_upsert(uint32_t space_id, uint32_t index_id, const char *tuple,
 	   const char *tuple_end, const char *ops, const char *ops_end,
 	   int index_base, box_tuple_t **result)
@@ -1334,7 +1334,7 @@ space_truncate(struct space *space)
 		diag_raise();
 }
 
-int
+API_EXPORT int
 box_truncate(uint32_t space_id)
 {
 	try {
@@ -1400,7 +1400,7 @@ sequence_data_delete(uint32_t seq_id)
 	return rc;
 }
 
-int
+API_EXPORT int
 box_sequence_next(uint32_t seq_id, int64_t *result)
 {
 	struct sequence *seq = sequence_cache_find(seq_id);
@@ -1417,7 +1417,7 @@ box_sequence_next(uint32_t seq_id, int64_t *result)
 	return 0;
 }
 
-int
+API_EXPORT int
 box_sequence_current(uint32_t seq_id, int64_t *result)
 {
 	struct sequence *seq = sequence_cache_find(seq_id);
@@ -1430,7 +1430,7 @@ box_sequence_current(uint32_t seq_id, int64_t *result)
 	return 0;
 }
 
-int
+API_EXPORT int
 box_sequence_set(uint32_t seq_id, int64_t value)
 {
 	struct sequence *seq = sequence_cache_find(seq_id);
@@ -1443,7 +1443,7 @@ box_sequence_set(uint32_t seq_id, int64_t value)
 	return sequence_data_update(seq_id, value);
 }
 
-int
+API_EXPORT int
 box_sequence_reset(uint32_t seq_id)
 {
 	struct sequence *seq = sequence_cache_find(seq_id);
diff --git a/src/lib/core/coio.cc b/src/lib/core/coio.cc
index e88d724d5..662eda631 100644
--- a/src/lib/core/coio.cc
+++ b/src/lib/core/coio.cc
@@ -711,7 +711,7 @@ coio_wait_cb(struct ev_loop *loop, ev_io *watcher, int revents)
 	fiber_wakeup(wdata->fiber);
 }
 
-int
+API_EXPORT int
 coio_wait(int fd, int events, double timeout)
 {
 	if (fiber_is_cancelled())
@@ -734,7 +734,8 @@ coio_wait(int fd, int events, double timeout)
 	return wdata.revents & (EV_READ | EV_WRITE);
 }
 
-int coio_close(int fd)
+API_EXPORT int
+coio_close(int fd)
 {
 	ev_io_closing(loop(), fd, EV_CUSTOM);
 	return close(fd);
-- 
2.24.1 (Apple Git-126)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Tarantool-patches] [PATCH] Code cleanup: sync declarations and definitions
  2020-04-13 19:33 [Tarantool-patches] [PATCH] Code cleanup: sync declarations and definitions Sergey Ostanevich
@ 2020-04-30 12:16 ` Kirill Yukhin
  0 siblings, 0 replies; 2+ messages in thread
From: Kirill Yukhin @ 2020-04-30 12:16 UTC (permalink / raw)
  To: Sergey Ostanevich; +Cc: tarantool-patches

Hello,

On 13 апр 22:33, Sergey Ostanevich wrote:
> 
> API_EXPORT defines nothrow, so compiler warns or errors depending on the
> build options in case function definition doesn't have the define.
> 
> Synced declarations and definitions for the functions caused build
> problems.
> 
> Closes #4885
> 
> https://github.com/tarantool/tarantool/issues/4885
> https://github.com/tarantool/tarantool/commit/980341a53e2a5d4ba30a21adfba5b2e045dfc078

I've checked your patch into 1.10, 2.3, 2.4 and master as obvious.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-30 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 19:33 [Tarantool-patches] [PATCH] Code cleanup: sync declarations and definitions Sergey Ostanevich
2020-04-30 12:16 ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox