Changed: #885 luabind (On Windows Breaks Compiling)

This commit is contained in:
kervala 2010-05-12 18:32:05 +02:00
parent a96d9bd1ba
commit def9d8761d

View file

@ -32,15 +32,13 @@
#define assert nlassert #define assert nlassert
#include <luabind/luabind.hpp> #include <luabind/luabind.hpp>
#if LUABIND_MAX_ARITY == 10 #if LUABIND_MAX_ARITY == 10
# define LUABIND_VERSION 07 # include <luabind/version.hpp>
# include <luabind/operator.hpp>
#elif LUABIND_MAX_ARITY == 5 #elif LUABIND_MAX_ARITY == 5
# define LUABIND_VERSION 06 # define LUABIND_VERSION 600
#else #else
# pragma error("luabind version not recognized") # pragma error("luabind version not recognized")
#endif #endif
#if LUABIND_VERSION == 07
# include <luabind/operator.hpp>
#endif
#include "lua_ihm.h" #include "lua_ihm.h"
@ -117,24 +115,6 @@ Compilation is VERY SLOW
*/ */
// *************************************************************************** // ***************************************************************************
// to get rid of you_must_not_use_assert___use_nl_assert___read_debug_h_file messages
#include <cassert>
#undef assert
#define assert nlassert
#include <luabind/luabind.hpp>
#if LUABIND_MAX_ARITY == 10
# define LUABIND_VERSION 07
#elif LUABIND_MAX_ARITY == 5
# define LUABIND_VERSION 06
#else
# pragma error("luabind version not recognized")
#endif
#if LUABIND_VERSION == 07
# include <luabind/operator.hpp>
#endif
using namespace NLMISC; using namespace NLMISC;
using namespace NLGEORGES; using namespace NLGEORGES;
using namespace R2; using namespace R2;
@ -225,7 +205,7 @@ bool CLuaIHM::pop(CLuaState &ls, NLMISC::CRGBA &dest)
try try
{ {
if (ls.isNil(-1)) return false; if (ls.isNil(-1)) return false;
#if LUABIND_VERSION == 07 #if LUABIND_VERSION > 600
luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1));
ls.pop(); ls.pop();
#else #else
@ -248,7 +228,7 @@ bool CLuaIHM::pop(CLuaState &ls,NLMISC::CVector2f &dest)
try try
{ {
if (ls.isNil(-1)) return false; if (ls.isNil(-1)) return false;
#if LUABIND_VERSION == 07 #if LUABIND_VERSION > 600
luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1));
ls.pop(); ls.pop();
#else #else
@ -271,7 +251,7 @@ bool CLuaIHM::pop(CLuaState &ls, ucstring &dest)
try try
{ {
if (ls.isNil(-1)) return false; if (ls.isNil(-1)) return false;
#if LUABIND_VERSION == 07 #if LUABIND_VERSION > 600
luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1));
ls.pop(); ls.pop();
#else #else
@ -310,7 +290,7 @@ void CLuaIHM::push(CLuaState &ls, const ucstring &value)
{ {
//H_AUTO(Lua_CLuaIHM_push) //H_AUTO(Lua_CLuaIHM_push)
luabind::object obj(ls.getStatePointer(), value); luabind::object obj(ls.getStatePointer(), value);
#if LUABIND_VERSION != 07 #if LUABIND_VERSION == 600
obj.pushvalue(); obj.pushvalue();
#endif #endif
} }
@ -668,7 +648,7 @@ void CLuaIHM::luaValueFromReflectedProperty(CLuaState &ls, CReflectable &reflect
case CReflectedProperty::UCString: case CReflectedProperty::UCString:
{ {
luabind::object obj(ls.getStatePointer(), (reflectedObject.*(property.GetMethod.GetUCString))() ); luabind::object obj(ls.getStatePointer(), (reflectedObject.*(property.GetMethod.GetUCString))() );
#if LUABIND_VERSION != 07 #if LUABIND_VERSION == 600
obj.pushvalue(); obj.pushvalue();
#endif #endif
} }
@ -676,7 +656,7 @@ void CLuaIHM::luaValueFromReflectedProperty(CLuaState &ls, CReflectable &reflect
case CReflectedProperty::RGBA: case CReflectedProperty::RGBA:
{ {
luabind::object obj(ls.getStatePointer(), (reflectedObject.*(property.GetMethod.GetRGBA))()); luabind::object obj(ls.getStatePointer(), (reflectedObject.*(property.GetMethod.GetRGBA))());
#if LUABIND_VERSION != 07 #if LUABIND_VERSION == 600
obj.pushvalue(); obj.pushvalue();
#endif #endif
} }
@ -2689,7 +2669,7 @@ int CLuaIHM::runExprAndPushResult(CLuaState &ls, const std::string &expr)
if(mustUseUCString) if(mustUseUCString)
{ {
luabind::object obj(ls.getStatePointer(), ucstr ); luabind::object obj(ls.getStatePointer(), ucstr );
#if LUABIND_VERSION != 07 #if LUABIND_VERSION == 600
obj.pushvalue(); obj.pushvalue();
#endif #endif
} }
@ -2702,7 +2682,7 @@ int CLuaIHM::runExprAndPushResult(CLuaState &ls, const std::string &expr)
case CInterfaceExprValue::RGBA: case CInterfaceExprValue::RGBA:
{ {
luabind::object obj(ls.getStatePointer(), value.getRGBA()); luabind::object obj(ls.getStatePointer(), value.getRGBA());
#if LUABIND_VERSION == 07 #if LUABIND_VERSION > 600
obj.push(ls.getStatePointer()); obj.push(ls.getStatePointer());
#else #else
obj.pushvalue(); obj.pushvalue();
@ -3342,7 +3322,7 @@ bool CLuaIHM::popString(CLuaState &ls, std::string & dest)
//H_AUTO(Lua_CLuaIHM_popString) //H_AUTO(Lua_CLuaIHM_popString)
try try
{ {
#if LUABIND_VERSION == 07 #if LUABIND_VERSION > 600
luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1));
ls.pop(); ls.pop();
#else #else
@ -3364,7 +3344,7 @@ bool CLuaIHM::popSINT32(CLuaState &ls, sint32 & dest)
//H_AUTO(Lua_CLuaIHM_popSINT32) //H_AUTO(Lua_CLuaIHM_popSINT32)
try try
{ {
#if LUABIND_VERSION == 07 #if LUABIND_VERSION > 600
luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1));
ls.pop(); ls.pop();
#else #else