We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 831e429 commit ee100efCopy full SHA for ee100ef
2 files changed
section4/lua_shared.cpp
@@ -7,6 +7,7 @@
7
8
extern "C" {
9
10
+int num = 10;
11
int my_add(int a, int b);
12
13
}
section4/shared.lua
@@ -10,6 +10,7 @@ local ffi_new = ffi.new
local ffi_C = ffi.C
ffi_cdef[[
+int num;
14
15
]]
16
@@ -20,5 +21,7 @@ print(jit.status())
20
21
22
local shared = ffi_load("./liblua_shared.so")
23
24
+print(shared.num)
25
+
26
local x = shared.my_add(1, 2)
27
print(x)
0 commit comments