[PATCH] compat: define ssize_t as int on 32bit Windows, silences C4142 warning

Adrian Buehlmann adrian at cadifra.com
Fri Jul 15 12:10:47 EDT 2016


On 2016-07-15 17:17, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1468594496 -32400
> #      Fri Jul 15 23:54:56 2016 +0900
> # Node ID 8268c3bd8718213a46ae5ff1d3d674fe77a815a7
> # Parent  2a692364f43bf27862ab001b905c5c8d61e59e6d
> compat: define ssize_t as int on 32bit Windows, silences C4142 warning
> 
> It appears Python.h provides ssize_t, which is aliased to int.
> 
> https://hg.python.org/cpython/file/v2.7.11/PC/pyconfig.h#l205
> 
> diff --git a/mercurial/compat.h b/mercurial/compat.h
> --- a/mercurial/compat.h
> +++ b/mercurial/compat.h
> @@ -8,7 +8,7 @@
>  #if defined(_WIN64)
>  typedef __int64 ssize_t;
>  #else
> -typedef long ssize_t;
> +typedef int ssize_t;
>  #endif
>  typedef signed char int8_t;
>  typedef short int16_t;

LGTM


More information about the Mercurial-devel mailing list