From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 88C70446423 for ; Sun, 12 Apr 2020 03:14:17 +0300 (MSK) Received: by smtp50.i.mail.ru with esmtpa (envelope-from ) id 1jNQGP-0005lJ-1u for tarantool-patches@dev.tarantool.org; Sun, 12 Apr 2020 03:14:17 +0300 From: Vladislav Shpilevoy Date: Sun, 12 Apr 2020 02:13:11 +0200 Message-Id: <1ccd273b230b6800c7b068a6503d4a52e878f9dd.1586650013.git.v.shpilevoy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 03/43] build: export src/lib/core/clock.c symbols List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Exports functions used by src/lua/clock.lua via FFI. Part of #2971 --- extra/exports | 8 -------- src/exports.c | 3 +++ src/lib/core/clock.c | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/extra/exports b/extra/exports index 9323996c1..6e6b5afd9 100644 --- a/extra/exports +++ b/extra/exports @@ -240,14 +240,6 @@ box_latch_delete box_latch_lock box_latch_trylock box_latch_unlock -clock_realtime -clock_monotonic -clock_process -clock_thread -clock_realtime64 -clock_monotonic64 -clock_process64 -clock_thread64 string_strip_helper # Lua / LuaJIT diff --git a/src/exports.c b/src/exports.c index 4bb423a57..378ebfb42 100644 --- a/src/exports.c +++ b/src/exports.c @@ -48,10 +48,13 @@ * Add new exporters here. Keep them in alphabetical order. */ +EXPORT(clock_export_syms); + void export_syms(void) { void *syms[] = { + clock_export_syms, }; const int func_count = sizeof(syms) / sizeof(syms[0]); for (int i = 0; i < func_count; ++i) diff --git a/src/lib/core/clock.c b/src/lib/core/clock.c index ff3058485..72ba5c5d9 100644 --- a/src/lib/core/clock.c +++ b/src/lib/core/clock.c @@ -108,3 +108,19 @@ clock_thread64(void) return (uint64_t) clock() * 1000000000 / CLOCKS_PER_SEC; #endif } + +void ** +clock_export_syms(void) +{ + static void *syms[] = { + (void *)clock_realtime, + (void *)clock_monotonic, + (void *)clock_process, + (void *)clock_thread, + (void *)clock_realtime64, + (void *)clock_monotonic64, + (void *)clock_process64, + (void *)clock_thread64, + }; + return syms; +} -- 2.21.1 (Apple Git-122.3)