[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Problems migrating lua_cpcall to version 5.3
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 3 Apr 2018 17:15:52 -0300
> I have some code which makes use of the deprecated function lua_cpcall:
> status = lua_cpcall(L, &pmain, &s);
> report(L, status);
> Now the manual says i have to replace lua_cpcall by lua_pushfunction and
> lua_pcall. What I don't understand: how can I hand over my arguments "s"
> with these new functions? They don't seem to have a possibility to deal
> with this kind of parameter which has to be forwarded to the called
> function "pmain"!
You pass it as a regular argument to your function:
status = lua_pcall(L, 1, 0, 0);