lua-users home
lua-l archive

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


Hello Lua Users!

When I was started including LuaThread in my project, I found some
incompatibilities ( with lua5.1alpha ):

first of all the sequence of difinitions in lua.h is not optimal:

...
#include "luaconf.h"
...
typedef struct lua_State lua_State;
...

in luaconf.h there is definitions of LUAI_EXTRASPACE,
luai_userstateopen and other correspondent macros, which can be
defined in other files. At the same time this files require  lua_State
definition.
I suggest to change definition sequence:

...
typedef struct lua_State lua_State;
typedef int (*lua_CFunction) (lua_State *L);
...
HERE CAN BE INSERTED MY INCLUDES
...
#include "luaconf.h"
...


and change from
#define LUAI_EXTRASPACE         0
to
#ifndef LUAI_EXTRASPACE
#define LUAI_EXTRASPACE         0
#endif

and same for other correspondent macros.

And one more question: where should I call luai_userstatefree
function?
luai_userstateopen function is called from lua_newstate.
May be place luai_userstatefree in lua_close?

-- 
Best regards,
Alexi Stukov
mailto:Stukov@gala.net