From accfb849f9a92e094617de4ff42a7b61ff2f265e Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 6 Jan 1997 22:42:50 +0000 Subject: added PyString_GET_SIZE macro for both PyString_GET_SIZE and PyString_AS_STRING, cast first argument to a PyStringObject* --- Include/stringobject.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Include/stringobject.h b/Include/stringobject.h index 2c3e568..c2565d8 100644 --- a/Include/stringobject.h +++ b/Include/stringobject.h @@ -79,7 +79,8 @@ extern int _PyString_Resize Py_PROTO((PyObject **, int)); 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 } -- cgit v0.12