mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-87347: Add parenthesis around macro arguments (#93915)
Add unit test on Py_MEMBER_SIZE() and some other macros.
This commit is contained in:
parent
61f24e7885
commit
7ad6f74fcf
30 changed files with 171 additions and 143 deletions
|
|
@ -135,14 +135,14 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
|
|||
|
||||
// Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly
|
||||
// PyObject_MALLOC() with _PyObject_SIZE().
|
||||
#define PyObject_NEW(type, typeobj) PyObject_New(type, typeobj)
|
||||
#define PyObject_NEW(type, typeobj) PyObject_New((type), (typeobj))
|
||||
|
||||
#define PyObject_NewVar(type, typeobj, n) \
|
||||
( (type *) _PyObject_NewVar((typeobj), (n)) )
|
||||
|
||||
// Alias to PyObject_NewVar(). In Python 3.8, PyObject_NEW_VAR() called
|
||||
// directly PyObject_MALLOC() with _PyObject_VAR_SIZE().
|
||||
#define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar(type, typeobj, n)
|
||||
#define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar((type), (typeobj), (n))
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue