[vlc-devel] [PATCH] lib: media: fix header include from MSVC

Thomas Guillem thomas at gllm.fr
Thu Oct 22 08:56:10 CEST 2020



On Thu, Oct 22, 2020, at 08:51, Martin Storsjö wrote:
> On Thu, 22 Oct 2020, Thomas Guillem wrote:
> 
> > ---
> > include/vlc/libvlc_media.h | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/include/vlc/libvlc_media.h b/include/vlc/libvlc_media.h
> > index 904e2655612..0bd3aace07e 100644
> > --- a/include/vlc/libvlc_media.h
> > +++ b/include/vlc/libvlc_media.h
> > @@ -33,6 +33,12 @@ extern "C" {
> > #  include <stdbool.h>
> > # endif
> > 
> > +/* ssize_t, a signed version of size_t, is Posix only and not present in MSVC */
> > +#if defined(_MSC_VER)
> > +#include <BaseTsd.h>
> > +typedef SSIZE_T ssize_t;
> > +#endif
> 
> While this is within a _MSC_VER block, I'd recommend sticking to 
> all-lowercase filenames, for consistency. (The WinSDK is still 
> self-inconsistent so one can't really use it on case sensitive file 
> systems unless one either adds a case insensitivity layer on top, or 
> lowercase everything. So sticking to lowercase would help if one were to 
> be build this e.g. with clang in MSVC mode on a case sensitive 
> filesystem.)

Thanks for your comment, will do.

Another solution is to change the definition of libvlc_media_read_cb() to return an int or int64_t. For me, 32bit is enough, you generally don't want to read 2GB at once.

> 
> 
> // Martin
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list