[vlc-devel] [PATCH 0/2] Libvlc formatted log callback

Rémi Denis-Courmont remi at remlab.net
Sun Jun 9 10:23:43 CEST 2019

Le perjantaina 31. toukokuuta 2019, 11.21.03 EEST Jeremy Vignelles via vlc-
devel a écrit :
> I still need to try that option, I don't know if getting a va_list as a
> void* in a callback, and passing it back to a native function (like
> vasprintf, that uses va_copy...) will work on all platforms. This feels
> quite wrong to assume that va_list is just a pointer.

It is not wrong to assume that va_list is a pointer on x86. It is however 
wrong to assume that you can call LibVLC directly from CIL on any combination 
of instruction set architecture and operating system.

As several people already noted, a thin native wrapper is usually used in 
between. If you don't do that, you'll have a lot of portability problems - not 
just with va_list.
> Moreover, we would need a libvlc_vasprintf exposed anyway, and from what
> I've read from Remi's comments, that's not really wanted either? I'd really
> prefer the "already formatted" way.

There is no need to expose anything here. vsnprintf and vsprintf are 
effectively stateless. It does not matter if you use the same as LibVLC does or 
another CRT's implementation.

Rémi Denis-Courmont

More information about the vlc-devel mailing list