1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

Fixed compilation error on GCC versions prior to 4.5

The deprecated attribute started accepting an optional string argument
in GCC version 4.5. Compiling libxml2 with GCC versions prior to that
would cause compilation errors such as:
```
./include/libxml/xmlmemory.h:134: error: wrong number of arguments specified for 'deprecated' attribute
```

Now the string argument is omitted for older versions of GCC.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
This commit is contained in:
Lars Erik Wik
2025-09-25 11:29:05 +02:00
parent da45a190f7
commit c537ccf0ae

View File

@@ -55,8 +55,12 @@
#ifndef XML_DEPRECATED
#if defined(IN_LIBXML)
#define XML_DEPRECATED
#elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301
#elif __GNUC__ * 100 + __GNUC_MINOR__ >= 405
/* GCC 4.5+ supports deprecated with message */
#define XML_DEPRECATED __attribute__((deprecated("See https://gnome.pages.gitlab.gnome.org/libxml2/html/deprecated.html")))
#elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301
/* GCC 3.1+ supports deprecated without message */
#define XML_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER) && _MSC_VER >= 1400
/* Available since Visual Studio 2005 */
#define XML_DEPRECATED __declspec(deprecated("See https://gnome.pages.gitlab.gnome.org/libxml2/html/deprecated.html"))