[PATCH] compat: provide a new declaration of hg_ssize_t, in case we don't have it

Maciej Fijalkowski fijall at gmail.com
Mon Jul 11 13:59:47 UTC 2016


On Mon, Jul 11, 2016 at 3:46 PM, Yuya Nishihara <yuya at tcha.org> wrote:
> On Mon, 11 Jul 2016 15:26:32 +0200, Maciej Fijalkowski wrote:
>> The working workaround (it's a bit hard to test) seems to be:
>>
>> #if defined(_MSC_VER)
>> #include <BaseTsd.h>
>> typedef SSIZE_T hg_ssize_t;
>> #else
>> typedef ssize_t hg_ssize_t
>> #endif
>
> (CC +adrian, I'm not Windows expert.)
>
> It seems to work on Visual Studio 2008, which is the default compiler of
> Python 2.7.
>
> I slightly prefer using ssize_t like other int/uint_ typedefs, i.e.
>
>   typedef SSIZE_T ssize_t;

what happens if ssize_t is already defined? (there are some windows
compilers that do it badly_



More information about the Mercurial-devel mailing list