From f02896261a93b047c1e52d3ff65c833be502089c Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 12 May 2010 18:32:05 +0200 Subject: [PATCH] Changed: #885 luabind (On Windows Breaks Compiling) --- .../ryzom/client/src/interface_v3/lua_ihm.cpp | 46 ++++++------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/lua_ihm.cpp b/code/ryzom/client/src/interface_v3/lua_ihm.cpp index 11d7da180..4945002ff 100644 --- a/code/ryzom/client/src/interface_v3/lua_ihm.cpp +++ b/code/ryzom/client/src/interface_v3/lua_ihm.cpp @@ -32,15 +32,13 @@ #define assert nlassert #include #if LUABIND_MAX_ARITY == 10 -# define LUABIND_VERSION 07 +# include +# include #elif LUABIND_MAX_ARITY == 5 -# define LUABIND_VERSION 06 +# define LUABIND_VERSION 600 #else # pragma error("luabind version not recognized") #endif -#if LUABIND_VERSION == 07 -# include -#endif #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 -#undef assert -#define assert nlassert -#include - -#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 -#endif - using namespace NLMISC; using namespace NLGEORGES; using namespace R2; @@ -225,7 +205,7 @@ bool CLuaIHM::pop(CLuaState &ls, NLMISC::CRGBA &dest) try { if (ls.isNil(-1)) return false; -#if LUABIND_VERSION == 07 +#if LUABIND_VERSION > 600 luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); ls.pop(); #else @@ -248,7 +228,7 @@ bool CLuaIHM::pop(CLuaState &ls,NLMISC::CVector2f &dest) try { if (ls.isNil(-1)) return false; -#if LUABIND_VERSION == 07 +#if LUABIND_VERSION > 600 luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); ls.pop(); #else @@ -271,7 +251,7 @@ bool CLuaIHM::pop(CLuaState &ls, ucstring &dest) try { if (ls.isNil(-1)) return false; -#if LUABIND_VERSION == 07 +#if LUABIND_VERSION > 600 luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); ls.pop(); #else @@ -310,7 +290,7 @@ void CLuaIHM::push(CLuaState &ls, const ucstring &value) { //H_AUTO(Lua_CLuaIHM_push) luabind::object obj(ls.getStatePointer(), value); -#if LUABIND_VERSION != 07 +#if LUABIND_VERSION == 600 obj.pushvalue(); #endif } @@ -668,7 +648,7 @@ void CLuaIHM::luaValueFromReflectedProperty(CLuaState &ls, CReflectable &reflect case CReflectedProperty::UCString: { luabind::object obj(ls.getStatePointer(), (reflectedObject.*(property.GetMethod.GetUCString))() ); -#if LUABIND_VERSION != 07 +#if LUABIND_VERSION == 600 obj.pushvalue(); #endif } @@ -676,7 +656,7 @@ void CLuaIHM::luaValueFromReflectedProperty(CLuaState &ls, CReflectable &reflect case CReflectedProperty::RGBA: { luabind::object obj(ls.getStatePointer(), (reflectedObject.*(property.GetMethod.GetRGBA))()); -#if LUABIND_VERSION != 07 +#if LUABIND_VERSION == 600 obj.pushvalue(); #endif } @@ -2689,7 +2669,7 @@ int CLuaIHM::runExprAndPushResult(CLuaState &ls, const std::string &expr) if(mustUseUCString) { luabind::object obj(ls.getStatePointer(), ucstr ); -#if LUABIND_VERSION != 07 +#if LUABIND_VERSION == 600 obj.pushvalue(); #endif } @@ -2702,7 +2682,7 @@ int CLuaIHM::runExprAndPushResult(CLuaState &ls, const std::string &expr) case CInterfaceExprValue::RGBA: { luabind::object obj(ls.getStatePointer(), value.getRGBA()); -#if LUABIND_VERSION == 07 +#if LUABIND_VERSION > 600 obj.push(ls.getStatePointer()); #else obj.pushvalue(); @@ -3342,7 +3322,7 @@ bool CLuaIHM::popString(CLuaState &ls, std::string & dest) //H_AUTO(Lua_CLuaIHM_popString) try { -#if LUABIND_VERSION == 07 +#if LUABIND_VERSION > 600 luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); ls.pop(); #else @@ -3364,7 +3344,7 @@ bool CLuaIHM::popSINT32(CLuaState &ls, sint32 & dest) //H_AUTO(Lua_CLuaIHM_popSINT32) try { -#if LUABIND_VERSION == 07 +#if LUABIND_VERSION > 600 luabind::object obj(luabind::from_stack(ls.getStatePointer(), -1)); ls.pop(); #else