diff --git a/nel/src/gui/lua_helper.cpp b/nel/src/gui/lua_helper.cpp index bb5fd5426..ed4106144 100644 --- a/nel/src/gui/lua_helper.cpp +++ b/nel/src/gui/lua_helper.cpp @@ -42,6 +42,12 @@ #define assert(x) #endif +// Always use unique_ptr with ValyriaTear/luabind on Ubuntu 20, +// since the setting is not stored in build_information.hpp +#ifndef LUABIND_USE_CXX11 +#define LUABIND_USE_CXX11 +#endif + #include #include #include diff --git a/nel/src/gui/lua_ihm.cpp b/nel/src/gui/lua_ihm.cpp index cdd87330c..229cd1f0f 100644 --- a/nel/src/gui/lua_ihm.cpp +++ b/nel/src/gui/lua_ihm.cpp @@ -48,6 +48,12 @@ # define assert(x) #endif +// Always use unique_ptr with ValyriaTear/luabind on Ubuntu 20, +// since the setting is not stored in build_information.hpp +#ifndef LUABIND_USE_CXX11 +#define LUABIND_USE_CXX11 +#endif + #include // in luabind > 0.6, LUABIND_MAX_ARITY is set to 10 #if LUABIND_MAX_ARITY == 10 @@ -220,7 +226,9 @@ namespace NLGUI void CLuaIHM::push(CLuaState &ls, const ucstring &value) { //H_AUTO(Lua_CLuaIHM_push) - #if LUABIND_VERSION > 600 + #if defined(LUABIND_STACK_HPP_INCLUDED) + luabind::push(ls.getStatePointer(), value); + #elif (LUABIND_VERSION > 600) luabind::detail::push(ls.getStatePointer(), value); #else luabind::object obj(ls.getStatePointer(), value); @@ -1156,7 +1164,9 @@ namespace NLGUI case CInterfaceExprValue::RGBA: { CRGBA color = value.getRGBA(); - #if LUABIND_VERSION > 600 + #if defined(LUABIND_STACK_HPP_INCLUDED) + luabind::push(ls.getStatePointer(), color); + #elif (LUABIND_VERSION > 600) luabind::detail::push(ls.getStatePointer(), color); #else luabind::object obj(ls.getStatePointer(), color); @@ -1416,7 +1426,9 @@ namespace NLGUI case CReflectedProperty::UCString: { ucstring str = (reflectedObject.*(property.GetMethod.GetUCString))(); - #if LUABIND_VERSION > 600 + #if defined(LUABIND_STACK_HPP_INCLUDED) + luabind::push(ls.getStatePointer(), str); + #elif (LUABIND_VERSION > 600) luabind::detail::push(ls.getStatePointer(), str); #else luabind::object obj(ls.getStatePointer(), str); @@ -1427,7 +1439,9 @@ namespace NLGUI case CReflectedProperty::UCStringRef: { ucstring str = (reflectedObject.*(property.GetMethod.GetUCStringRef))(); - #if LUABIND_VERSION > 600 + #if defined(LUABIND_STACK_HPP_INCLUDED) + luabind::push(ls.getStatePointer(), str); + #elif (LUABIND_VERSION > 600) luabind::detail::push(ls.getStatePointer(), str); #else luabind::object obj(ls.getStatePointer(), str); @@ -1442,7 +1456,9 @@ namespace NLGUI case CReflectedProperty::RGBA: { CRGBA color = (reflectedObject.*(property.GetMethod.GetRGBA))(); - #if LUABIND_VERSION > 600 + #if defined(LUABIND_STACK_HPP_INCLUDED) + luabind::push(ls.getStatePointer(), color); + #elif (LUABIND_VERSION > 600) luabind::detail::push(ls.getStatePointer(), color); #else luabind::object obj(ls.getStatePointer(), color); diff --git a/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp b/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp index c87102c9e..c1c931528 100644 --- a/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp +++ b/ryzom/client/src/interface_v3/lua_ihm_ryzom.cpp @@ -41,6 +41,12 @@ # define assert(x) #endif +// Always use unique_ptr with ValyriaTear/luabind on Ubuntu 20, +// since the setting is not stored in build_information.hpp +#ifndef LUABIND_USE_CXX11 +#define LUABIND_USE_CXX11 +#endif + #include // in luabind > 0.6, LUABIND_MAX_ARITY is set to 10 #if LUABIND_MAX_ARITY == 10 diff --git a/ryzom/tools/leveldesign/variable_parser/lua_helper.cpp b/ryzom/tools/leveldesign/variable_parser/lua_helper.cpp index 2bb462664..bca003d6a 100644 --- a/ryzom/tools/leveldesign/variable_parser/lua_helper.cpp +++ b/ryzom/tools/leveldesign/variable_parser/lua_helper.cpp @@ -30,6 +30,13 @@ extern "C" #include #undef assert #define assert nlassert + +// Always use unique_ptr with ValyriaTear/luabind on Ubuntu 20, +// since the setting is not stored in build_information.hpp +#ifndef LUABIND_USE_CXX11 +#define LUABIND_USE_CXX11 +#endif + #include using namespace std;