diff Include/stringobject.h @ 4897:90c21dde4284 legacy-trunk

added PyString_GET_SIZE macro for both PyString_GET_SIZE and PyString_AS_STRING, cast first argument to a PyStringObject*
author Barry Warsaw <barry@python.org>
date Mon, 06 Jan 1997 22:42:50 +0000
parents df81856db58c
children 65aace2012e5
line wrap: on
line diff
--- a/Include/stringobject.h	Mon Jan 06 22:42:00 1997 +0000
+++ b/Include/stringobject.h	Mon Jan 06 22:42:50 1997 +0000
@@ -79,7 +79,8 @@
 extern PyObject *PyString_Format Py_PROTO((PyObject *, PyObject *));
 
 /* Macro, trading safety for speed */
-#define PyString_AS_STRING(op) ((op)->ob_sval)
+#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval)
+#define PyString_GET_SIZE(op)  (((PyStringObject *)(op))->ob_size)
 
 #ifdef __cplusplus
 }