Skip to content

libvlc: use ptrdiff_t instead of POSIX ssize_t in libvlc

Steve Lhomme requested to merge robUx4/vlc:libvlc-mem-intptr_t into master

ssize_t is not a standard C type. In some cases it's supposed to hold no more than a long [1]. That's 2 GB in normal case which is enough for 16k*16k 16-bit RGBA.

The implementation shall support one or more programming environments in which the widths of blksize_t, pid_t, size_t, ssize_t, and suseconds_t are no greater than the width of type long. The names of these programming environments can be obtained using the confstr() function or the getconf utility.

Make sure the new type is equivalent to the old one so we don't break ABI. And a recompilation will hopefully not bring any warning (otherwise the type assumed to be ssize_t by the host app was not correct).

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

Less breaking than !1507 (closed) or !1510 (closed). If all CI are not breaking with the static_assert, that means ptrdiff_t is equivalent to ssize_t in all our targets so it should not break anything.

Edited by Steve Lhomme

Merge request reports