*If* we really don't like this (IMO perfectly reasonable) usage we could change the API/ABI design to be C compatible by adding a level of indirection. Vis:
struct GraphicsPlatformEntry { virtual mir::UniqueModulePtr<mir::graphics::Platform> create_host_platform( std::shared_ptr<mir::options::Option> const& options, std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, std::shared_ptr<mir::graphics::DisplayReport> const& report) = 0; };
// This is the published entry point. NB Ownership is not transferred. extern "C" GraphicsPlatformEntry* graphics_platform_entry;
// client code does: if (void* p = dlvsym(so, "graphics_platform_entry", version)) { return static_cast<GraphicsPlatformEntry*>(p) ->create_stub_platform(the_options(), the_emergency_cleanup(), the_display_report()); }
« Back to merge proposal
*If* we really don't like this (IMO perfectly reasonable) usage we could change the API/ABI design to be C compatible by adding a level of indirection. Vis:
struct GraphicsPlatfor mEntry lePtr<mir: :graphics: :Platform> create_ host_platform( :shared_ ptr<mir: :options: :Option> const& options, :shared_ ptr<mir: :EmergencyClean upRegistry> const& emergency_ cleanup_ registry, :shared_ ptr<mir: :graphics: :DisplayReport> const& report) = 0;
{
virtual mir::UniqueModu
std:
std:
std:
};
// This is the published entry point. NB Ownership is not transferred. mEntry* graphics_ platform_ entry;
extern "C" GraphicsPlatfor
// client code does: platform_ entry", version)) cast<GraphicsPl atformEntry* >(p)
->create_ stub_platform( the_options( ), the_emergency_ cleanup( ), the_display_ report( ));
if (void* p = dlvsym(so, "graphics_
{
return static_
}