slightly improved, but still hackish way to recognize luabind versions.

This commit is contained in:
Enno Rehling 2006-01-02 20:24:33 +00:00
parent bf6dbe4b26
commit 83e9b7a994
11 changed files with 21 additions and 14 deletions

View File

@ -14,7 +14,7 @@
#include <lua.hpp>
#include <luabind/luabind.hpp>
#include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
#if LUABIND_BETA >= 7
# include <luabind/operator.hpp>
#endif

View File

@ -25,7 +25,7 @@
#include <luabind/iterator_policy.hpp>
#include <luabind/out_value_policy.hpp>
#include <luabind/copy_policy.hpp>
#ifdef HAVE_LUABIND_B7
#if LUABIND_BETA >= 7
# include <luabind/operator.hpp>
#endif

View File

@ -15,7 +15,7 @@
#include <lua.hpp>
#include <luabind/luabind.hpp>
#include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
#if LUABIND_BETA >= 7
# include <luabind/operator.hpp>
#endif

View File

@ -52,7 +52,7 @@ namespace eressea {
}
}
}
#ifdef LUABIND_OLD
#if LUABIND_BETA<7 || (LUABIND_BETA==7 && LUABIND_DEVEL<2)
return object(L); // nil
#else
return object(); // nil

View File

@ -17,7 +17,7 @@
#include <lua.hpp>
#include <luabind/luabind.hpp>
#include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
#if LUABIND_BETA >= 7
# include <luabind/operator.hpp>
#endif

View File

@ -192,7 +192,7 @@ lua_changeresource(unit * u, const struct resource_type * rtype, int delta)
bool
is_function(struct lua_State * luaState, const char * fname)
{
#ifndef LUABIND_OLD
#if LUABIND_BETA>7 || (LUABIND_BETA==7 && LUABIND_DEVEL>=2)
object g = globals(luaState);
object fun = g[fname];
if (fun.is_valid()) {

View File

@ -11,7 +11,7 @@
#include <lua.hpp>
#include <luabind/luabind.hpp>
#include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
#if LUABIND_BETA >= 7
# include <luabind/operator.hpp>
#endif

View File

@ -31,7 +31,7 @@
#include <lua.hpp>
#include <luabind/luabind.hpp>
#include <luabind/iterator_policy.hpp>
#ifdef HAVE_LUABIND_B7
#if LUABIND_BETA>=7
# include <luabind/operator.hpp>
#endif

View File

@ -458,7 +458,7 @@ usage(const char * prog, const char * arg)
static void
setLuaString(lua_State * luaState, const char * name, const char * value)
{
#ifdef LUABIND_OLD
#if LUABIND_BETA<7 || (LUABIND_BETA==7 && LUABIND_DEVEL<2)
luabind::object g = luabind::get_globals(luaState);
#else
luabind::object g = luabind::globals(luaState);
@ -469,7 +469,7 @@ setLuaString(lua_State * luaState, const char * name, const char * value)
static void
setLuaNumber(lua_State * luaState, const char * name, double value)
{
#ifdef LUABIND_OLD
#if LUABIND_BETA<7 || (LUABIND_BETA==7 && LUABIND_DEVEL<2)
luabind::object g = luabind::get_globals(luaState);
#else
luabind::object g = luabind::globals(luaState);

View File

@ -3,7 +3,14 @@ extern "C" {
#include <lua50/lauxlib.h>
#include <lua50/lualib.h>
}
#include <boost/version.hpp>
#if BOOST_VERSION < 103300
# define LUABIND_OLD
#ifndef LUABIND_BETA
# include <boost/version.hpp>
# if BOOST_VERSION < 103300
# define LUABIND_BETA 7
# define LUABIND_DEVEL 1
# else
# define LUABIND_BETA 7
# define LUABIND_DEVEL 2
# endif
#endif

View File

@ -38,7 +38,7 @@
region of Muschelplateau.
</text>
<text locale="de">
Dieses Abzeichen identifiziert die Partei seines Träger offiziell
Dieses Abzeichen identifiziert die Partei seines Trägers offiziell
als einen Besucher der Botschafterregion 'Muschelplateau'.
</text>
</string>