diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-09-01 18:42:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-01 18:42:42 (GMT) |
commit | 0e01fac315dfa705ac8a6954485546f28cf4c87d (patch) | |
tree | 7c2553acdbee7e017a5bad3e02649522f971fb6b /Modules/_testcapi/dict.c | |
parent | 578ebc5d5fab2e5e0b87636361c6aeb8d2b287fa (diff) | |
download | cpython-0e01fac315dfa705ac8a6954485546f28cf4c87d.zip cpython-0e01fac315dfa705ac8a6954485546f28cf4c87d.tar.gz cpython-0e01fac315dfa705ac8a6954485546f28cf4c87d.tar.bz2 |
Add Modules/_testcapi/util.h header (GH-108774)
It contains common macros used in C API tests.
Diffstat (limited to 'Modules/_testcapi/dict.c')
-rw-r--r-- | Modules/_testcapi/dict.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/Modules/_testcapi/dict.c b/Modules/_testcapi/dict.c index 6c3f9cd..6720f04 100644 --- a/Modules/_testcapi/dict.c +++ b/Modules/_testcapi/dict.c @@ -1,24 +1,7 @@ #include <stddef.h> // ptrdiff_t #include "parts.h" - -#define NULLABLE(x) do { if (x == Py_None) x = NULL; } while (0); - -#define RETURN_INT(value) do { \ - int _ret = (value); \ - if (_ret == -1) { \ - return NULL; \ - } \ - return PyLong_FromLong(_ret); \ - } while (0) - -#define RETURN_SIZE(value) do { \ - Py_ssize_t _ret = (value); \ - if (_ret == -1) { \ - return NULL; \ - } \ - return PyLong_FromSsize_t(_ret); \ - } while (0) +#include "util.h" static PyObject * |