From: Guido van Rossum Date: Thu, 22 Aug 1996 22:55:47 +0000 (+0000) Subject: Add PYTHON_API_STRING, which is PYTHON_API_VERSION as a string literal. X-Git-Tag: v1.4b3~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ea0b0649874ff1654fc67db14b9a13582d9307a;p=thirdparty%2FPython%2Fcpython.git Add PYTHON_API_STRING, which is PYTHON_API_VERSION as a string literal. Under Windows, add MS_DLL_ID and MS_DLL_VERSION_ID for Mark H. Independent change: if Py_TRACE_REFS is defined, rename Py_InitModule4 so so linking with incompatible modules will create a link time error. [Backing out of previous changes (also for modsupport.c) to test the latter at runtime.] --- diff --git a/Include/modsupport.h b/Include/modsupport.h index c6ea541193b8..4d2652398bff 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -53,6 +53,7 @@ extern int PyArg_VaParse Py_PROTO((PyObject *, char *, va_list)); extern PyObject *Py_VaBuildValue Py_PROTO((char *, va_list)); #define PYTHON_API_VERSION 1005 +#define PYTHON_API_STRING "1005" /* The API version is maintained (independently from the Python version) so we can detect mismatches between the interpreter and dynamically loaded modules. These are diagnosticised by an error message but @@ -60,6 +61,9 @@ extern PyObject *Py_VaBuildValue Py_PROTO((char *, va_list)); after loading the module). The error message is intended to explain the core dump a few seconds later. + The symbol PYTHON_API_STRING defines the same value as a string + literal. *** PLEASE MAKE SURE THE DEFINITIONS MATCH. *** + Please add a line or two to the top of this log for each API version change: @@ -74,6 +78,24 @@ extern PyObject *Py_VaBuildValue Py_PROTO((char *, va_list)); 9-Jan-1995 GvR Initial version (incompatible with older API) */ +#ifdef MS_WINDOWS +/* Special defines for Windows versions. MS_DLL_ID is the key + used in the registry. + The full MS_DLL_VERSION_ID is imbedded in the core DLL, and + is so installers can determine incremental changes. +*/ +#define MS_DLL_ID "1.4.0" +#define MS_DLL_VERSION_ID MS_DLL_ID "." PYTHON_API_STRING + +#endif /* MS_WINDOWS */ + +#ifdef Py_TRACE_REFS +/* When we are tracing reference counts, rename Py_InitModule4 so + modules compiled with incompatible settings will generate a + link-time error. */ +#define Py_InitModule4 Py_InitModule4TraceRefs +#endif + extern PyObject *Py_InitModule4 Py_PROTO((char *, PyMethodDef *, char *, PyObject *, int)); #define Py_InitModule(name, methods) \