Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/ext/python_debug.h
8817 views
1
/*
2
* Workaround to handle Python preprocessor macros: Translate defined /
3
* undefined into true / false
4
*/
5
6
7
#include <Python.h>
8
9
#ifdef Py_DEBUG
10
#define SAGE_Py_DEBUG Py_DEBUG
11
#else
12
#define SAGE_Py_DEBUG 0
13
#endif
14
15
#ifdef Py_REF_DEBUG
16
#define SAGE_Py_REF_DEBUG Py_REF_DEBUG
17
#else
18
#define SAGE_Py_REF_DEBUG 0
19
#endif
20
21
#ifdef Py_TRACE_REFS
22
#define SAGE_Py_TRACE_REFS Py_TRACE_REFS
23
#define if_Py_TRACE_REFS_then_PyObject_INIT(obj, type) PyObject_INIT(obj, type)
24
#else
25
#define SAGE_Py_TRACE_REFS 0
26
#define if_Py_TRACE_REFS_then_PyObject_INIT(obj, type)
27
#endif
28
29
#ifdef PYMALLOC_DEBUG
30
#define SAGE_PYMALLOC_DEBUG PYMALLOC_DEBUG
31
#else
32
#define SAGE_PYMALLOC_DEBUG 0
33
#endif
34
35
#ifdef WITH_PYMALLOC
36
#define SAGE_WITH_PYMALLOC PYMALLOC_DEBUG
37
#else
38
#define SAGE_WITH_PYMALLOC 0
39
#endif
40
41
42
43
44