[LV2] lv2_descriptor() considered harmful

David Robillard d at drobilla.net
Thu Mar 15 10:31:27 PDT 2012


On Thu, 2012-03-15 at 18:24 +0100, Stefan Kersten wrote:
> On 3/15/12 6:17 PM, David Robillard wrote:
> > On Sun, 2012-02-26 at 17:03 -0500, David Robillard wrote:
> >> /**
> >>     Prototype for library accessor function.
> >>
> >>     This is the entry point for a plugin library.  Hosts load this
> >>     symbol from the library and call this function to obtain a
> >>     library descriptor which can be used to access all the UIs
> >>     contained in this library.  The returned object must not be
> >>     destroyed (using LV2_Lib_Descriptor::cleanup()) until all
> >>     plugins loaded from that library have been destroyed.
> >> */
> >> LV2_Lib_Descriptor const*
> >> lv2_lib_descriptor(const char*                bundle_path,
> >>                     const LV2_Feature *const * features);
> >>
> >> /**
> >>     Type of the lv2_lib_descriptor() function in an LV2 library.
> >> */
> >> typedef LV2_Lib_Descriptor const*
> >> (*LV2_Lib_Descriptor_Func)(const char*                bundle_path,
> >>                             const LV2_Feature *const * features);
> >
> > Should we perhaps avoid requiring a dlsym of a function, which is
> > technically not portable and usually a cause of at least a warning?
> 
> could you elaborate why it's not portable?

Standard C does not allow casting between function and data pointers.

I am not sure how it impacts real world platforms.

-dr





More information about the Devel mailing list