Skip to content

[3.0] libvlc: use ptrdiff_t instead of POSIX ssize_t in libvlc

Steve Lhomme requested to merge robUx4/vlc:30-ssize_t into 3.0.x

Backport of 4671cfb4 on 3.0. The ABI should not be impacted as ptrdiff_t was picked to have the same ties to memory sizes as a signed size_t.

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 no bring any warning (otherwise that was assumed to be ssize_t by the host app was not correct).

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

Merge request reports