summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapi/dict.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-09-01 18:42:42 (GMT)
committerGitHub <noreply@github.com>2023-09-01 18:42:42 (GMT)
commit0e01fac315dfa705ac8a6954485546f28cf4c87d (patch)
tree7c2553acdbee7e017a5bad3e02649522f971fb6b /Modules/_testcapi/dict.c
parent578ebc5d5fab2e5e0b87636361c6aeb8d2b287fa (diff)
downloadcpython-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.c19
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 *