[vlc-devel] libvlccore, name-clashes and problems with getopt
Mathieu SCHROETER
mathieu.schroeter at gamesover.ch
Sat Feb 27 23:34:50 CET 2010
Rémi Denis-Courmont a écrit :
> ----- Original message -----
>> I'm trying to use libvlc for a project, and there are several
>> potential clashes with libvlccore. The namespace uses in libvlc.so
>> is fine, always libvlc_. But libvlc.so is linked against
>> libvlccore.so where the namespaces are not consistent.
> But it would be a major PITA to fix in VLC. I do not know if symbol
> versioning or anything can work-around this.
>
To prepend (for example "vlc_") to every non-static function of
libvlccore it is not an acceptable solution (for 1.2 of course)?
>> When using libvlc in a program with getopt.. It is necessary to be
>> sure that libvlc is initialized _only after_ the use of optind,
>> etc,.. Otherwise, libvlccore changes the value of optind for
>> example,..
>
> True. But Libvlc needs to parse its command line afterall. The only
> "fix" would require inlining getopt_long() which is not particularly
> clean either. But this is a thread-safety problem, so perhaps it has
> to be done anyway.
An other way is to reimplement without getopt.. at least, the parser
itself can be copied from the sources of getopt.
It looks perfectly doable but I understand if it is not a priority.
getopt is mostly (only?) used in src/config/cmdline.c, I'm right?
--
Mathieu SCHROETER
More information about the vlc-devel
mailing list