[vlc-devel] how can i change ssize_t in "typedef ssize_t (*libvlc_media_read_cb)(void *opaque, unsigned char *buf, size_t len); " to compile in vs2019

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Dec 21 10:29:17 UTC 2020



On Mon, Dec 21, 2020, at 11:19 AM, Alexandre Janniaux wrote:
> Hi,
> 
> ssize_t (and size_t iirc) are not defined by msvc headers,

AFAIR size_t is not an issue, but indeed ssize_t is

> but the Windows SDK defines SIZE_T and SSIZE_T, so you can
> typedef/define them when compiling with MSVC, before
> including VLC headers.
> 
> Other windows developers might have a more precise code
> snippet but I fear they might be unavailable currently.
> 

#include <basetsd.h>
typedef SSIZE_T ssize_t;

is what we usually use

> Regards,
> --
> Alexandre Janniaux
> Videolabs
> 
> On Mon, Dec 21, 2020 at 01:31:32PM +0800, Mashomii wrote:
> > Hello Everyone!
> > I've been using the excellent VLC sdk to display a RTSP stream in a winform application.
> >
> >
> > The callback declaration
> >
> > "typedef ssize_t (*libvlc_media_read_cb)(void *opaque, unsigned char *buf,  size_t len);"
> > in header file
> >
> > "vlc-3.0.11-win32\vlc-3.0.11\sdk\include\vlc\libvlc_media.h"
> > doesn't compile in VS2019.
> >
> >
> > It seems the "ssize_t" doesn't exits on vc++ compiler headers.
> >
> >
> > How should I change the type "ssize_t" to using the sdk?
> 
> > _______________________________________________
> > vlc-devel mailing list
> > To unsubscribe or modify your subscription options:
> > https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list