# HG changeset patch # User Matt Mackall # Date 1334077629 18000 # Node ID 8d821a173e4ed2791fcb6057e82c966faf16cf4e # Parent f5dd179bfa4a52454f4e4bc609ce74abdcce7032 util.h: move Py_ssize_t bits from mpatch.c diff -r f5dd179bfa4a -r 8d821a173e4e mercurial/mpatch.c --- a/mercurial/mpatch.c Sun Apr 08 12:43:41 2012 -0700 +++ b/mercurial/mpatch.c Tue Apr 10 12:07:09 2012 -0500 @@ -26,16 +26,6 @@ #include "util.h" -/* Definitions to get compatibility with python 2.4 and earlier which - does not have Py_ssize_t. See also PEP 353. - Note: msvc (8 or earlier) does not have ssize_t, so we use Py_ssize_t. -*/ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -#define PY_SSIZE_T_MAX INT_MAX -#define PY_SSIZE_T_MIN INT_MIN -#endif - #ifdef _WIN32 #ifdef _MSC_VER /* msvc 6.0 has problems */ diff -r f5dd179bfa4a -r 8d821a173e4e mercurial/util.h --- a/mercurial/util.h Sun Apr 08 12:43:41 2012 -0700 +++ b/mercurial/util.h Tue Apr 10 12:07:09 2012 -0500 @@ -102,8 +102,15 @@ #endif /* PY_VERSION_HEX */ #if (PY_VERSION_HEX < 0x02050000) +/* Definitions to get compatibility with python 2.4 and earlier which + does not have Py_ssize_t. See also PEP 353. + Note: msvc (8 or earlier) does not have ssize_t, so we use Py_ssize_t. +*/ typedef int Py_ssize_t; +#if !defined(PY_SSIZE_T_MIN) +#define PY_SSIZE_T_MAX INT_MAX +#define PY_SSIZE_T_MIN INT_MIN +#endif #endif #endif /* _HG_UTIL_H_ */ -