Bugs in External Libraries

Luabind

If you get errors like this during Vitrall compilation:

/usr/include/c++/4.4/bits/stl_pair.h: In constructor ‘std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = int, _U2 = int, _T1 = void*, _T2 = int]’:
/usr/include/luabind/detail/object_rep.hpp:58:   instantiated from here
/usr/include/c++/4.4/bits/stl_pair.h:90: error: invalid conversion from ‘int’ to ‘void*’

following changes need to be applied to Luabind headers:

In file luabind/detail/object_rep.hpp, in method looking like this:

std::pair<void*, int> get_instance(class_id target) const
{
    if (m_instance == 0)
        return std::pair<void*, int>(0, -1);
    return m_instance->get(target);
}

instruction:

return std::pair<void*, int>(0, -1);

needs to be changed to:

return std::pair<void*, int>((void *), -1);

In file luabind/detail/instance_holder.hpp, in method looking like this:

    std::pair<void*, int> get(class_id target) const
    {
        if (target == registered_class<P>::id)
            return std::pair<void*, int>(&this->p, 0);

        void* naked_ptr = const_cast<void*>(static_cast<void const*>(
            weak ? weak : get_pointer(p)));

        if (!naked_ptr)
            return std::pair<void*, int>((void *)0, 0);

        return get_class()->casts().cast(
            naked_ptr
          , static_class_id(false ? get_pointer(p) : 0)
          , target
          , dynamic_id
          , dynamic_ptr
        );
    }

instruction:

return std::pair<void*, int>(0, 0);

needs to be changed to:

return std::pair<void*, int>((void *)0, 0);