-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathlua.patch
More file actions
82 lines (68 loc) · 2.19 KB
/
lua.patch
File metadata and controls
82 lines (68 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff --git a/Makefile b/Makefile
index 72ca8ff..4a4a968 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
-PLAT= guess
+PLAT=posix
# Where to install. The installation starts in the src and doc directories,
# so take care if INSTALL_TOP is not an absolute path. See the local target.
diff --git a/src/Makefile b/src/Makefile
index b771196..feaf768 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,15 +4,15 @@
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
-PLAT= guess
+PLAT=posix
-CC= gcc -std=gnu99
+CC= emcc -std=gnu99
CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
-AR= ar rcu
-RANLIB= ranlib
+AR= emar rcu
+RANLIB= emranlib
RM= rm -f
UNAME= uname
@@ -20,8 +20,8 @@ SYSCFLAGS=
SYSLDFLAGS=
SYSLIBS=
-MYCFLAGS=
-MYLDFLAGS=
+MYCFLAGS= -g -sSUPPORT_LONGJMP=wasm -pthread
+MYLDFLAGS= -g -sSUPPORT_LONGJMP=wasm -pthread
MYLIBS=
MYOBJS=
diff --git a/src/lapi.c b/src/lapi.c
index 332e97d..73f5250 100644
--- a/src/lapi.c
+++ b/src/lapi.c
@@ -930,7 +930,7 @@ LUA_API void lua_rawseti (lua_State *L, int idx, lua_Integer n) {
}
-LUA_API int lua_setmetatable (lua_State *L, int objindex) {
+LUA_API void lua_setmetatable (lua_State *L, int objindex) {
TValue *obj;
Table *mt;
lua_lock(L);
@@ -966,7 +966,6 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) {
}
L->top.p--;
lua_unlock(L);
- return 1;
}
diff --git a/src/lua.h b/src/lua.h
index f050dac..0e407bf 100644
--- a/src/lua.h
+++ b/src/lua.h
@@ -282,7 +282,7 @@ LUA_API void (lua_seti) (lua_State *L, int idx, lua_Integer n);
LUA_API void (lua_rawset) (lua_State *L, int idx);
LUA_API void (lua_rawseti) (lua_State *L, int idx, lua_Integer n);
LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p);
-LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
+LUA_API void (lua_setmetatable) (lua_State *L, int objindex);
LUA_API int (lua_setiuservalue) (lua_State *L, int idx, int n);