1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00

Add XML_DEPRECATED macro

__attribute__((deprecated)) is available since at least GCC 3.1, so an
exact version check is probably unnecessary.
This commit is contained in:
Nick Wellnhofer 2022-02-20 18:19:27 +01:00
parent 346c3a930c
commit a2fe74c08a
2 changed files with 21 additions and 0 deletions

View File

@ -456,6 +456,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
# define LIBXML_ATTR_FORMAT(fmt,args)
#endif
#ifndef XML_DEPRECATED
# ifdef IN_LIBXML
# define XML_DEPRECATED
# else
/* Available since at least GCC 3.1 */
# define XML_DEPRECATED __attribute__((deprecated))
# endif
#endif
#else /* ! __GNUC__ */
/**
* ATTRIBUTE_UNUSED:
@ -475,6 +484,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Macro used to indicate to GCC the parameter are printf like
*/
#define LIBXML_ATTR_FORMAT(fmt,args)
/**
* XML_DEPRECATED:
*
* Macro used to indicate that a function, variable, type or struct member
* is deprecated.
*/
#ifndef XML_DEPRECATED
#define XML_DEPRECATED
#endif
#endif /* __GNUC__ */
#ifdef __cplusplus

View File

@ -8,6 +8,9 @@
* daniel@veillard.com
*/
/* Disable deprecation warnings */
#define XML_DEPRECATED
#include "libxml.h"
#include <stdio.h>