luabind: using define LUABIND_OLD instead of BOOST_VERSION

This commit is contained in:
Enno Rehling 2005-11-25 22:25:13 +00:00
parent cd70cfcb8b
commit 6e76a3d601
4 changed files with 9 additions and 5 deletions

View File

@ -35,10 +35,11 @@ variant
opstack_pop(opstack ** stackp) opstack_pop(opstack ** stackp)
{ {
opstack * stack = *stackp; opstack * stack = *stackp;
variant v = *(--stack->top);
assert(stack); assert(stack);
assert(stack->top>stack->begin); assert(stack->top>stack->begin);
return *(--stack->top); return v;
} }
void void

View File

@ -191,7 +191,7 @@ lua_changeresource(unit * u, const struct resource_type * rtype, int delta)
bool bool
is_function(struct lua_State * luaState, const char * fname) is_function(struct lua_State * luaState, const char * fname)
{ {
#if BOOST_VERSION > 103002 #ifndef LUABIND_OLD
object globals = globals(luaState); object globals = globals(luaState);
object fun = globals[fname]; object fun = globals[fname];
if (fun.is_valid()) { if (fun.is_valid()) {

View File

@ -457,10 +457,10 @@ usage(const char * prog, const char * arg)
static void static void
setLuaString(lua_State * luaState, const char * name, const char * value) setLuaString(lua_State * luaState, const char * name, const char * value)
{ {
#if BOOST_VERSION > 103002 #ifdef LUBIND_OLD
luabind::object globals = luabind::globals(luaState);
#else
luabind::object globals = luabind::get_globals(luaState); luabind::object globals = luabind::get_globals(luaState);
#else
luabind::object globals = luabind::globals(luaState);
#endif #endif
globals[name] = value; globals[name] = value;
} }

View File

@ -3,3 +3,6 @@ extern "C" {
#include <lua50/lauxlib.h> #include <lua50/lauxlib.h>
#include <lua50/lualib.h> #include <lua50/lualib.h>
} }
#if BOOST_VERSION < 103300
# define LUABIND_OLD
#endif