From 1fe626990444f7634220f8a63c17862787126799 Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Sat, 23 Sep 2006 05:19:30 +0000 Subject: [PATCH] Piet Delport patches: final cleanup and PEP 353 macros. --- ChangeLog | 2 ++ psycopg/psycopg.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0afaf34d..bb7ec315 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2006-09-23 Federico Di Gregorio + * psycopg/psycopg.h: applied compatibility macros from PEP 353. + * Applied patch 1/3 from Piet Delport; from his email: psycopg2-Py_ssize_t-input.diff adjusts variables used for parameters and return values. These changes only prevent overflowing on values diff --git a/psycopg/psycopg.h b/psycopg/psycopg.h index a689ea45..5ee3a46a 100644 --- a/psycopg/psycopg.h +++ b/psycopg/psycopg.h @@ -28,6 +28,13 @@ extern "C" { #endif +/* Python 2.5 ssize_t compatibility */ +#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 + /* DBAPI compliance parameters */ #define APILEVEL "2.0" #define THREADSAFETY 2