Skip to content
  • Steve Lhomme's avatar
    libvlc: use ptrdiff_t instead of POSIX ssize_t in libvlc · 4671cfb4
    Steve Lhomme authored and Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen committed
    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
    4671cfb4