From d242631245edb66816ef9960bdb2c61b68e56cec Mon Sep 17 00:00:00 2001
From: phosit <phosit@3db68df2-c116-0410-a063-a993310a9797>
Date: Wed, 13 Dec 2023 19:42:00 +0000
Subject: [PATCH] Fix build with libxml2 v2.12.1

Index: source/ps/XML/RelaxNG.cpp
--- source/ps/XML/RelaxNG.cpp.orig
+++ source/ps/XML/RelaxNG.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2021 Wildfire Games.
+/* Copyright (C) 2023 Wildfire Games.
  * This file is part of 0 A.D.
  *
  * 0 A.D. is free software: you can redistribute it and/or modify
@@ -25,9 +25,11 @@
 #include "ps/CStr.h"
 #include "ps/Filesystem.h"
 
+#include <libxml/parser.h>
 #include <libxml/relaxng.h>
 #include <map>
 #include <mutex>
+#include <type_traits>
 
 TIMER_ADD_CLIENT(xml_validation);
 
@@ -46,7 +48,8 @@ void ClearSchemaCache()
 	g_SchemaCache.clear();
 }
 
-static void relaxNGErrorHandler(void* UNUSED(userData), xmlErrorPtr error)
+static void relaxNGErrorHandler(void* UNUSED(userData),
+	std::conditional_t<LIBXML_VERSION >= 21200, const xmlError, xmlError>* error)
 {
 	// Strip a trailing newline
 	std::string message = error->message;
