[PATCH] compat: provide a declaration of ssize_t, for MS windows

Adrian Buehlmann adrian at cadifra.com
Tue Jul 12 14:01:14 EDT 2016


On 2016-07-12 19:16, Maciej Fijalkowski wrote:
> # HG changeset patch
> # User Maciej Fijalkowski <fijall at gmail.com>
> # Date 1468238015 -7200
> #      Mon Jul 11 13:53:35 2016 +0200
> # Node ID 54968a2233db1823fa11f47dcc99395097bae3b4
> # Parent  b40939504d0e01e3a7f067b8cf49f26718a7c27c
> compat: provide a declaration of ssize_t, for MS windows
> 
> diff -r b40939504d0e -r 54968a2233db mercurial/compat.h
> --- a/mercurial/compat.h	Mon Jul 11 11:05:08 2016 +0200
> +++ b/mercurial/compat.h	Mon Jul 11 13:53:35 2016 +0200
> @@ -5,6 +5,8 @@
>  #ifdef _MSC_VER
>  /* msvc 6.0 has problems */
>  #define inline __inline
> +#include <BaseTsd.h>
> +typedef SSIZE_T ssize_t;
>  typedef signed char int8_t;
>  typedef short int16_t;
>  typedef long int32_t;

Perhaps, this can be simplified to:

#if defined(_WIN64)
 typedef __int64 ssize_t;
#else
 typedef long ssize_t;
#endif

(and thusly avoiding including BaseTsd.h ...)


More information about the Mercurial-devel mailing list