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

Martin Storsjö martin at martin.st
Thu Oct 22 08:51:59 CEST 2020


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.)


// Martin



More information about the vlc-devel mailing list