Re: Purpose for replace explicit linkage to lua dlls (lua52.dll, lua53.dll etc)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Purpose for replace explicit linkage to lua dlls (lua52.dll, lua53.dll etc)
- From: Joshua Jensen <josh.jjensen@...>
- Date: 2015年7月20日 17:26:36 -0600
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