Don't declare PyBool_Type, PyLong_Type and PySys_Audit() twice, but
only once.
Compiler warnings seen by building Python with gcc -Wredundant-decls.
#endif
-PyAPI_DATA(PyTypeObject) PyBool_Type;
+// PyBool_Type is declared by object.h
#define PyBool_Check(x) Py_IS_TYPE((x), &PyBool_Type)
typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *);
-PyAPI_FUNC(int) PySys_Audit(
- const char *event,
- const char *format,
- ...);
PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*);
typedef struct {
/* Long (arbitrary precision) integer object interface */
-PyAPI_DATA(PyTypeObject) PyLong_Type;
+// PyLong_Type is declared by object.h
#define PyLong_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
--- /dev/null
+Fix redundant declarations in the public C API. Declare PyBool_Type,
+PyLong_Type and PySys_Audit() only once. Patch by Victor Stinner.