[Yake-svn] SF.net SVN: yake: [1763] trunk/yake
Status: Beta
Brought to you by:
psyclonist
From: <psy...@us...> - 2007-07-17 19:31:14
|
Revision: 1763 http://svn.sourceforge.net/yake/?rev=1763&view=rev Author: psyclonist Date: 2007-07-17 12:31:14 -0700 (Tue, 17 Jul 2007) Log Message: ----------- fixed GCC 4.1.2 related standard compliance issues and added a workaround for a Luabind bug regarding get_const_holder overloads Modified Paths: -------------- trunk/yake/src/bindings.lua/detail/task.lua.cpp trunk/yake/yake/bindings.lua/common/yake.lua.any_converter.cpp Modified: trunk/yake/src/bindings.lua/detail/task.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/task.lua.cpp 2007-06-22 17:31:05 UTC (rev 1762) +++ trunk/yake/src/bindings.lua/detail/task.lua.cpp 2007-07-17 19:31:14 UTC (rev 1763) @@ -27,6 +27,20 @@ #include <yake/config.h> #if YAKE_ENABLE_LUA_TASK == 1 +// We include yake.lua.shared_ptr.h PRIOR to including any Luabind headers. +// Reasoning: While on MSVC 8 there's no problem GCC 4.1.x fails miserably complaining +// about "you_need_to_define_a_get_const_holder_function_for_your_smart_ptr". +// This is intended to be the indicator that the luabind::get_const_holder() +// overload was not defined for the smart pointer. +// BUT: +// This is actually a bug in Luabind as "it assumes that overloaded functions +// are bound at instantiation time of templates, but overloaded functions are +// bound at definition time, so the luabind" code "only sees the +// luabind::get_const_holder(...) catch all handler. +// (Source: http://osdir.com/ml/lang.lua.bind.user/2006-02/msg00008.html) +// Solution: Include the overloads for our smart pointers PRIOR to any Luabind headers. +#include <yake/bindings.lua/common/yake.lua.shared_ptr.h> + #include <yake/bindings.lua/bindings.lua.h> // Don't forget to include this for proper dllexport! #include <yake/base/templates/yakeSmartAssert.h> @@ -34,11 +48,11 @@ #include <yake/bindings.lua/detail/private.h> #include <yake/bindings.lua/common/lua.helpers.h> #include <yake/bindings.lua/common/vminfo.lua.h> -#include <yake/bindings.lua/common/yake.lua.shared_ptr.h> #include <yake/bindings.lua/common/yake.lua.any_converter.h> #include <yake/task/task.h> + namespace yake { namespace task { Modified: trunk/yake/yake/bindings.lua/common/yake.lua.any_converter.cpp =================================================================== --- trunk/yake/yake/bindings.lua/common/yake.lua.any_converter.cpp 2007-06-22 17:31:05 UTC (rev 1762) +++ trunk/yake/yake/bindings.lua/common/yake.lua.any_converter.cpp 2007-07-17 19:31:14 UTC (rev 1763) @@ -41,7 +41,7 @@ void convert_cpp_to_lua(lua_State* L, const boost::any& a) { typedef void(*conv_t)(lua_State* L, const boost::any&); - const type_info* ti = &a.type(); + const std::type_info* ti = &a.type(); // special case: 'boost::any(void)' is converted to 'nil' if (ti == &typeid(void)) @@ -69,9 +69,9 @@ case LUA_TSTRING: return boost::any( object_cast<std::string>(o) ); //@todo fixme default: - throw std::exception("encountered unsupported type in convert_lua_to_cpp()"); + throw yake::Exception("encountered unsupported type in convert_lua_to_cpp()"); } - throw std::exception("encountered unsupported type in convert_lua_to_cpp()"); + throw yake::Exception("encountered unsupported type in convert_lua_to_cpp()"); } boost::any convert_lua_to_cpp(lua_State* L, by_const_reference<boost::any>, int index) { @@ -85,9 +85,9 @@ case LUA_TSTRING: return boost::any( object_cast<std::string>(o) ); //@todo fixme default: - throw std::exception("encountered unsupported type in convert_lua_to_cpp()"); + throw yake::Exception("encountered unsupported type in convert_lua_to_cpp()"); } - throw std::exception("encountered unsupported type in convert_lua_to_cpp()"); + throw yake::Exception("encountered unsupported type in convert_lua_to_cpp()"); } int match_lua_to_cpp(lua_State* L, by_value<boost::any>, int index) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |