From 525014c4bdce23f0502a7464db46bffa46c7f50d Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
Date: Wed, 11 Jun 2025 23:47:58 +0200
Subject: [PATCH] Define macro ATTRIBUTE_UNUSED that libxml2 2.14.0 no longer
 exposes

https://bugs.gentoo.org/955674
---
 src/xml_pyx.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/xml_pyx.c b/src/xml_pyx.c
index ab295f1..bc28c1d 100644
--- a/src/xml_pyx.c
+++ b/src/xml_pyx.c
@@ -21,6 +21,18 @@
 
 #include "xmlstar.h"
 
+/**
+ * libxml2 2.14.0 no longer defines macro ATTRIBUTE_UNUSED for us
+ * https://github.com/GNOME/libxml2/commit/208f27f9641a59863ce1f7d4992df77f7eb0ea9d
+ */
+#if ! defined(ATTRIBUTE_UNUSED)
+# if __GNUC__ * 100 + __GNUC_MINOR__ >= 207
+#  define ATTRIBUTE_UNUSED __attribute__((unused))
+# else
+#  define ATTRIBUTE_UNUSED
+# endif
+#endif
+
 /**
  *  Output newline and tab characters as escapes
  *  Required both for attribute values and character data (#PCDATA)
-- 
2.49.0

