mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Use an assert() for the REQ() macro instead of making up our own
assertion.
This commit is contained in:
parent
a8bcf80e7b
commit
5aace07fe0
1 changed files with 1 additions and 10 deletions
|
|
@ -27,16 +27,7 @@ extern DL_IMPORT(void) PyNode_Free(node *n);
|
|||
#define STR(n) ((n)->n_str)
|
||||
|
||||
/* Assert that the type of a node is what we expect */
|
||||
#ifndef Py_DEBUG
|
||||
#define REQ(n, type) { /*pass*/ ; }
|
||||
#else
|
||||
#define REQ(n, type) \
|
||||
{ if (TYPE(n) != (type)) { \
|
||||
fprintf(stderr, "FATAL: node type %d, required %d\n", \
|
||||
TYPE(n), type); \
|
||||
abort(); \
|
||||
} }
|
||||
#endif
|
||||
#define REQ(n, type) assert(TYPE(n) == (type))
|
||||
|
||||
extern DL_IMPORT(void) PyNode_ListTree(node *);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue