From 5c8770f8969a73cf4ca503f54c2217f76de62e04 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sat, 13 May 2017 10:04:33 -0300 Subject: back to old-style vararg system (with vararg table collecting extra arguments) --- ldo.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ldo.h') diff --git a/ldo.h b/ldo.h index b2065cfa..4717620f 100644 --- a/ldo.h +++ b/ldo.h @@ -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); -- cgit v1.2.3-55-g6feb