util.h: move Py_ssize_t bits from mpatch.c
authorMatt Mackall <mpm@selenic.com>
Tue, 10 Apr 2012 12:07:09 -0500
changeset 16384 8d821a173e4e
parent 16383 f5dd179bfa4a
child 16385 e501f45b0eba
util.h: move Py_ssize_t bits from mpatch.c
mercurial/mpatch.c
mercurial/util.h
--- 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 */
--- 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_ */
-