diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-03-21 10:07:41 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-03-23 07:42:57 -0400 |
commit | 5aee45879681a7a76754a25b3f4f96b4529f7ae3 (patch) | |
tree | 04698477d38cf45871c7542eea6ce6a8d2b46a18 /gdb/python/python-internal.h | |
parent | edae3fd6600f10f9e16dc017b705959f541ed19a (diff) | |
download | binutils-5aee45879681a7a76754a25b3f4f96b4529f7ae3.zip binutils-5aee45879681a7a76754a25b3f4f96b4529f7ae3.tar.gz binutils-5aee45879681a7a76754a25b3f4f96b4529f7ae3.tar.bz2 |
gdb/python: remove Python 2/3 compatibility macros
New in this version:
- Rebase on master, fix a few more issues that appeared.
python-internal.h contains a number of macros that helped make the code
work with both Python 2 and 3. Remove them and adjust the code to use
the Python 3 functions.
Change-Id: I99a3d80067fb2d65de4f69f6473ba6ffd16efb2d
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r-- | gdb/python/python-internal.h | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index ccf440c..d947b96 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -89,15 +89,6 @@ #define Py_TPFLAGS_CHECKTYPES 0 -#define PyInt_Check PyLong_Check -#define PyInt_AsLong PyLong_AsLong -#define PyInt_AsSsize_t PyLong_AsSsize_t - -#define PyString_FromString PyUnicode_FromString -#define PyString_Decode PyUnicode_Decode -#define PyString_FromFormat PyUnicode_FromFormat -#define PyString_Check PyUnicode_Check - /* If Python.h does not define WITH_THREAD, then the various GIL-related functions will not be defined. However, PyGILState_STATE will be. */ @@ -141,19 +132,6 @@ typedef long Py_hash_t; #define PyMem_RawMalloc PyMem_Malloc #endif -/* Python 2.6 did not wrap Py_DECREF in 'do {...} while (0)', leading - to 'suggest explicit braces to avoid ambiguous ‘else’' gcc errors. - Wrap it ourselves, so that callers don't need to care. */ - -static inline void -gdb_Py_DECREF (void *op) /* ARI: editCase function */ -{ - Py_DECREF (op); -} - -#undef Py_DECREF -#define Py_DECREF(op) gdb_Py_DECREF (op) - /* PyObject_CallMethod's 'method' and 'format' parameters were missing the 'const' qualifier before Python 3.4. Hence, we wrap the function in our own version to avoid errors with string literals. |