1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

Warn when using deprecated functions from Python bindings

This requires Python code to be run with -Wd.
This commit is contained in:
Nick Wellnhofer
2022-03-01 13:57:16 +01:00
parent b66ce0bba8
commit ebc5009793
3 changed files with 47 additions and 3 deletions

View File

@@ -60,6 +60,21 @@
#define ATTRIBUTE_UNUSED
#endif
/*
* Macros to ignore deprecation warnings
*/
#if defined(__clang__) || \
(defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406))
#define XML_IGNORE_DEPRECATION_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define XML_POP_WARNINGS \
_Pragma("GCC diagnostic pop")
#else
#define XML_IGNORE_PEDANTIC_WARNINGS
#define XML_POP_WARNINGS
#endif
#define PyxmlNode_Get(v) (((v) == Py_None) ? NULL : \
(((PyxmlNode_Object *)(v))->obj))
@@ -277,3 +292,5 @@ PyObject * libxml_xmlSchemaSetValidErrors(PyObject * self, PyObject * args);
PyObject * libxml_xmlRegisterInputCallback(PyObject *self, PyObject *args);
PyObject * libxml_xmlUnregisterInputCallback(PyObject *self, PyObject *args);
PyObject * libxml_xmlNodeRemoveNsDef(PyObject * self, PyObject * args);
int libxml_deprecationWarning(const char *func);