summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2000-07-17 09:22:55 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2000-07-17 09:22:55 (GMT)
commitcf5f3587849e6fbdc68dc91bd3182625f616f2a0 (patch)
treedf751c239b30c82a159d31b30ad7785c765614b2 /Include
parentaf36a3aa2046dc14af5c3b5e77390ccb5c44f3f1 (diff)
downloadcpython-cf5f3587849e6fbdc68dc91bd3182625f616f2a0.zip
cpython-cf5f3587849e6fbdc68dc91bd3182625f616f2a0.tar.gz
cpython-cf5f3587849e6fbdc68dc91bd3182625f616f2a0.tar.bz2
Restore PyXXX_Length() APIs for binary compatibility.
New code will see the macros and therefore use the PyXXX_Size() APIs instead. By Thomas Wouters.
Diffstat (limited to 'Include')
-rw-r--r--Include/abstract.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/Include/abstract.h b/Include/abstract.h
index b765c4b..7a6b7cf 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -383,8 +383,6 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
DL_IMPORT(int) PyObject_Size(PyObject *o);
-#define PyObject_Length PyObject_Size
-
/*
Return the size of object o. If the object, o, provides
both sequence and mapping protocols, the sequence size is
@@ -393,6 +391,12 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
+ /* For DLL compatibility */
+#undef PyObject_Length
+ DL_IMPORT(int) PyObject_Length(PyObject *o);
+#define PyObject_Length PyObject_Size
+
+
DL_IMPORT(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key);
/*
@@ -685,13 +689,17 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
DL_IMPORT(int) PySequence_Size(PyObject *o);
-#define PySequence_Length PySequence_Size
-
/*
Return the size of sequence object o, or -1 on failure.
*/
+ /* For DLL compatibility */
+#undef PySequence_Length
+ DL_IMPORT(int) PySequence_Length(PyObject *o);
+#define PySequence_Length PySequence_Size
+
+
DL_IMPORT(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2);
/*
@@ -839,14 +847,18 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
DL_IMPORT(int) PyMapping_Size(PyObject *o);
-#define PyMapping_Length PyMapping_Size
-
/*
Returns the number of keys in object o on success, and -1 on
failure. For objects that do not provide sequence protocol,
this is equivalent to the Python expression: len(o).
*/
+ /* For DLL compatibility */
+#undef PyMapping_Length
+ DL_IMPORT(int) PyMapping_Length(PyObject *o);
+#define PyMapping_Length PyMapping_Size
+
+
/* implemented as a macro:
int PyMapping_DelItemString(PyObject *o, char *key);