Fix Lua examples for running under Lua 5.2
Includes cherry picking parts of
ce2760f77e
This commit is contained in:
parent
0ed98c0606
commit
bf313809ae
6 changed files with 26 additions and 11 deletions
|
|
@ -4,6 +4,7 @@ TARGET = embed
|
|||
SRCS = example.c
|
||||
INTERFACE = example.i
|
||||
LUA_INTERP = embed.c
|
||||
LIBS = -lm
|
||||
|
||||
# this is a little different to normal as we have our own special interpreter
|
||||
# which we want to static link
|
||||
|
|
@ -12,7 +13,7 @@ check: build
|
|||
|
||||
build:
|
||||
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) SRCS='$(SRCS)' SWIG='$(SWIG)' \
|
||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static
|
||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' LIBS='$(LIBS)' INTERFACE='example.i' LUA_INTERP='$(LUA_INTERP)' lua_static
|
||||
|
||||
clean:
|
||||
$(MAKE) -f $(TOP)/Makefile lua_clean
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ We will be using the luaL_dostring()/lua_dostring() function to call into lua
|
|||
#include <lauxlib.h>
|
||||
#include <lualib.h>
|
||||
|
||||
#if LUA_VERSION_NUM > 501
|
||||
#define lua_open luaL_newstate
|
||||
#endif
|
||||
|
||||
/* the SWIG wrappered library */
|
||||
extern int luaopen_example(lua_State*L);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue