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

Rémi Denis-Courmont remi at remlab.net
Sat May 18 10:05:43 CEST 2019


Le perjantaina 17. toukokuuta 2019, 12.23.44 EEST Romain Vimont a écrit :
> On Fri, May 17, 2019 at 10:04:59AM +0200, Jérémy VIGNELLES wrote:
> > Hi,
> > 
> > In libvlc, there is currently a `libvlc_log_set` function, that can
> > register log callback in a vprintf style, that is, with a `va_list`
> > argument.
> I agree that we should avoid va_list in callbacks :)
> 
> > This is nice when you are trying to call from C, but when using other
> > languages like C# or Java, va_list is impossible to get right, and even
> > if it did, those languages do not provide ways to format that kind of
> > stuff.
> 
> (not counter-arguments, just comments)
> 
> I don't know C#, but in Java you will need a JNI layer in C, so it can
> be handled here.

DotNet has a special syntax to bind native function call symbols as regular 
DotNet methods.

But it is designed for Windows DLL and Win32/COM type system, and basically 
fails to account for anything outside of that, such as signedness of char, 
width of long, versioning of shared objects, process-wide symbol namespace, 
etc. So if you try to run the same code on Mono (or vice versa), it will fail 
(been there, done that).

If you want to write really portable code,  you don't typically use DotNet, I 
believe. And if you do, there you probably have a native portability framework 
underneath.

-- 
Реми Дёни-Курмон
http://www.remlab.net/





More information about the vlc-devel mailing list