compile time constant to differentiate 1.5.2 from 1.5.1?

Dale Nagata DNagata at creo.com
Thu Dec 2 00:47:24 EST 1999


On Wednesday, December 01, 1999 12:04 AM, Fredrik Lundh
[SMTP:fredrik at pythonware.com] wrote:
> > Does anyone know what compile time macros can be used
> > to detect whether I'm compiling against 1.5.2 or 1.5.1?
> > 
> > I searched through the headers in a 1.5.1 distribution
> > and didn't see any obvious version identification macros.
> > 
> 
> PYTHON_API_VERSION
> 

Hmm, for 1.5.1 modsupport.h says

#define PYTHON_API_VERSION 1007
#define PYTHON_API_STRING "1007"

and for 1.5.2 it says

#define PYTHON_API_VERSION 1007
#define PYTHON_API_STRING "1007"

Now that I have a 1.5.2 source tree to look at, I see
that patchlevel.h defines some new macros that didn't
exist before:

   This scheme was added in Python 1.5.2b2; before that time, only
PATCHLEVEL
   was available.  To test for presence of the scheme, test for
   defined(PY_MAJOR_VERSION).

Thanks,


--
Dale Nagata         |  tel : +1 604.451.2700 ext. 2254 (UTC-0800)
Software Developer  |  fax : +1 604.437.9891 
Creo Products Inc.  |  pgr : +1 604.691.8279
Burnaby BC Canada   |  http://www.creo.com/





More information about the Python-list mailing list