summaryrefslogtreecommitdiff
path: root/src/lj_lib.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_lib.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lj_lib.h b/src/lj_lib.h
index 44be96b9..fd2b025c 100644
--- a/src/lj_lib.h
+++ b/src/lj_lib.h
@@ -57,6 +57,19 @@ LJ_FUNC int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst);
57#define lj_lib_checkfpu(L) UNUSED(L) 57#define lj_lib_checkfpu(L) UNUSED(L)
58#endif 58#endif
59 59
60/* Push internal function on the stack. */
61static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f,
62 int id, int n)
63{
64 GCfunc *fn;
65 lua_pushcclosure(L, f, n);
66 fn = funcV(L->top-1);
67 fn->c.ffid = (uint8_t)id;
68 setmref(fn->c.pc, &G(L)->bc_cfunc_int);
69}
70
71#define lj_lib_pushcf(L, fn, id) (lj_lib_pushcc(L, (fn), (id), 0))
72
60/* Library function declarations. Scanned by buildvm. */ 73/* Library function declarations. Scanned by buildvm. */
61#define LJLIB_CF(name) static int lj_cf_##name(lua_State *L) 74#define LJLIB_CF(name) static int lj_cf_##name(lua_State *L)
62#define LJLIB_ASM(name) static int lj_ffh_##name(lua_State *L) 75#define LJLIB_ASM(name) static int lj_ffh_##name(lua_State *L)