lua-users home
lua-l archive

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


Alexander Kluev wrote on 7/20/15 4:24 PM:
currently any C library have to be explicit linked to corresponding lua dll such as lua52.dll, lua53.dll etc so once compiled C lib is depended from some version of lua core lib and may not compatible with current lua environment for example user ivnoke 5.3 based lua interpreter and via "require" load 5.2 based C library solution for solve this problem is passing to luaopen_* function struct with pointer to lua api functions instead explicit linkage to lua*.dll

// new struct in lua.h
struct LuaAPI
{
    int        version;
    void    (*pushcfunction)(lua_State *L, lua_CFunction f);
    int        (*lua_gettop (lua_State *L);
    // and other
};
It's been brought up before on at least one occasion [1].

-Josh

[1] http://lua-users.org/lists/lua-l/2009-12/msg00379.html