/usr/include/boost/dll/detail
Edit: /usr/include/boost/dll/detail/type_info.hpp (2676B)
// Copyright 2016 Klemens Morgenstern, Antony Polukhin
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org
#ifndef BOOST_DLL_DETAIL_TYPE_INFO_HPP_
#define BOOST_DLL_DETAIL_TYPE_INFO_HPP_
#include
#include
#include
#if defined(_MSC_VER) // MSVC, Clang-cl, and ICC on Windows
#include
#endif
namespace boost { namespace dll { namespace detail {
#if defined(_MSC_VER) // MSVC, Clang-cl, and ICC on Windows
#if defined ( _WIN64 )
template
const std::type_info& load_type_info(Lib & lib, Storage & storage)
{
struct RTTICompleteObjectLocator
{
boost::winapi::DWORD_ signature; //always zero ?
boost::winapi::DWORD_ offset; //offset of this vtable in the complete class
boost::winapi::DWORD_ cdOffset; //constructor displacement offset
boost::winapi::DWORD_ pTypeDescriptorOffset; //TypeDescriptor of the complete class
boost::winapi::DWORD_ pClassDescriptorOffset; //describes inheritance hierarchy (ignored)
};
RTTICompleteObjectLocator** vtable_p = &lib.template get(storage.template get_vtable());
vtable_p--;
auto vtable = *vtable_p;
auto nat = reinterpret_cast(lib.native());
nat += vtable->pTypeDescriptorOffset;
return *reinterpret_cast(nat);
}
#else
template
const std::type_info& load_type_info(Lib & lib, Storage & storage)
{
struct RTTICompleteObjectLocator
{
boost::winapi::DWORD_ signature; //always zero ?
boost::winapi::DWORD_ offset; //offset of this vtable in the complete class
boost::winapi::DWORD_ cdOffset; //constructor displacement offset
const std::type_info* pTypeDescriptor; //TypeDescriptor of the complete class
void* pClassDescriptor; //describes inheritance hierarchy (ignored)
};
RTTICompleteObjectLocator** vtable_p = &lib.template get(storage.template get_vtable());
vtable_p--;
auto vtable = *vtable_p;
return *vtable->pTypeDescriptor;
}
#endif //_WIN64
#else
template
const std::type_info& load_type_info(Lib & lib, Storage & storage)
{
return lib.template get(storage.template get_type_info());
}
#endif
}}}
#endif /* BOOST_DLL_DETAIL_TYPE_INFO_HPP_ */