lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]





On 30 September 2013 12:56, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> Lua cannot represent or use a generic function pointer on the Lua
> side (other than as a void pointer), [...]

Lua 5.2 can, with a light C function. (Of course, you should never expose
that value to any Lua code that could try to call it.)

-- Roberto


I have hidden none lua_CFunctions in Lua before just by casting it to the expected signature, when I needed to call in C I recast it to the correct type and called it; which is perfectly valid C. Casting to a void pointer is however either undefined or implementation defined.

--Liam