]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106320: Remove _Py_SwappedOp from the C API (#107036)
authorVictor Stinner <vstinner@python.org>
Sat, 22 Jul 2023 16:07:07 +0000 (18:07 +0200)
committerGitHub <noreply@github.com>
Sat, 22 Jul 2023 16:07:07 +0000 (16:07 +0000)
Move _Py_SwappedOp to the internal C API (pycore_object.h).

Include/cpython/object.h
Include/internal/pycore_object.h
Objects/object.c

index 0e5b6acb43b41617d102c7dececf652edb0947f5..49101c1875686078169a99d726c2f3ac4f7b856f 100644 (file)
@@ -377,11 +377,6 @@ PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
 #endif
 
 
-/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
- * Defined in object.c.
- */
-PyAPI_DATA(int) _Py_SwappedOp[];
-
 PyAPI_FUNC(void)
 _PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
                        size_t sizeof_block);
index 90588daa64cc3beaba237446916abbbdc99cc5e2..a9c996557430ad5ccccc5abbcc77fea3271df826 100644 (file)
@@ -442,6 +442,9 @@ extern PyObject* _PyCFunctionWithKeywords_TrampolineCall(
 PyAPI_DATA(PyTypeObject) _PyNone_Type;
 PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;
 
+/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.  Defined in Objects/object.c. */
+PyAPI_DATA(int) _Py_SwappedOp[];
+
 #ifdef __cplusplus
 }
 #endif
index bfbc87198f5b3c1f04f9542771572e0ae5a81459..3b8839b87726141acfe3551ecc8640fe1ff5e783 100644 (file)
@@ -9,7 +9,7 @@
 #include "pycore_floatobject.h"   // _PyFloat_DebugMallocStats()
 #include "pycore_initconfig.h"    // _PyStatus_EXCEPTION()
 #include "pycore_namespace.h"     // _PyNamespace_Type
-#include "pycore_object.h"        // _PyType_CheckConsistency(), _Py_FatalRefcountError()
+#include "pycore_object.h"        // PyAPI_DATA() _Py_SwappedOp definition
 #include "pycore_pyerrors.h"      // _PyErr_Occurred()
 #include "pycore_pymem.h"         // _PyMem_IsPtrFreed()
 #include "pycore_pystate.h"       // _PyThreadState_GET()