[Tarantool-patches] [PATCH 23/43] build: export src/main.cc symbols

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Apr 12 03:13:04 MSK 2020


Exports functions used by src/lua/init.lua via FFI.

Part of #2971
---
 extra/exports |  2 --
 src/exports.c |  2 ++
 src/main.cc   | 10 ++++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/extra/exports b/extra/exports
index 0f068ceac..c6c656c06 100644
--- a/extra/exports
+++ b/extra/exports
@@ -7,8 +7,6 @@ ibuf_reinit
 ibuf_destroy
 ibuf_reserve_slow
 
-tarantool_uptime
-tarantool_exit
 space_by_id
 space_run_triggers
 space_bsize
diff --git a/src/exports.c b/src/exports.c
index 1f9617126..cfb952b01 100644
--- a/src/exports.c
+++ b/src/exports.c
@@ -54,6 +54,7 @@ EXPORT(crc32_export_syms);
 EXPORT(csv_export_syms);
 EXPORT(exception_export_syms);
 EXPORT(fiber_export_syms);
+EXPORT(main_export_syms);
 EXPORT(PMurHash32_export_syms);
 EXPORT(port_export_syms);
 EXPORT(random_export_syms);
@@ -75,6 +76,7 @@ export_syms(void)
 		csv_export_syms,
 		exception_export_syms,
 		fiber_export_syms,
+		main_export_syms,
 		PMurHash32_export_syms,
 		port_export_syms,
 		random_export_syms,
diff --git a/src/main.cc b/src/main.cc
index 712c70bc0..53e947402 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -911,3 +911,13 @@ main(int argc, char **argv)
 	tarantool_free();
 	return exit_code;
 }
+
+extern "C" void **
+main_export_syms(void)
+{
+	static void *syms[] = {
+		(void *)tarantool_exit,
+		(void *)tarantool_uptime,
+	};
+	return syms;
+}
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list