back to old-style vararg system (with vararg table collecting extra

arguments)
This commit is contained in:
Roberto Ierusalimschy
2017-05-13 10:04:33 -03:00
parent 7647d5d13d
commit 5c8770f896
7 changed files with 74 additions and 72 deletions

10
ldo.h
View File

@@ -1,5 +1,5 @@
/*
** $Id: ldo.h,v 2.28 2015/11/23 11:29:43 roberto Exp roberto $
** $Id: ldo.h,v 2.29 2015/12/21 13:02:14 roberto Exp roberto $
** Stack and Call structure of Lua
** See Copyright Notice in lua.h
*/
@@ -33,6 +33,14 @@
#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
/* macro to check stack size, preserving 'p' */
#define checkstackp(L,n,p) \
luaD_checkstackaux(L, n, \
ptrdiff_t t__ = savestack(L, p); /* save 'p' */ \
luaC_checkGC(L), /* stack grow uses memory */ \
p = restorestack(L, t__)) /* 'pos' part: restore 'p' */
/* type of protected functions, to be ran by 'runprotected' */
typedef void (*Pfunc) (lua_State *L, void *ud);