mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
added PyString_GET_SIZE macro
for both PyString_GET_SIZE and PyString_AS_STRING, cast first argument to a PyStringObject*
This commit is contained in:
parent
1f2bd07aed
commit
accfb849f9
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue