File 0001-fix-fcollada-error.patch of Package 0ad

From: https://src.fedoraproject.org/rpms/0ad/blob/master/f/0ad-fcollada.patch
From: Simon Vogl <simon.vogl@gmx.net>
Date: Sat,  1 Aug 2020 11:28:41 UTC
Subject: [PATCH] Fix compilation failure of 0ad on openSUSE Tumbleweed
Due to a bug in fcollada, this patch is required for 0ad to compile with GCC10.
It is already merged upstream and can safely be deleted for 0ad versions greater than 0.0.23b.
Thanks to pcpa from Fedora for this patch.

diff -up 0ad-0.0.23b-alpha/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h.orig 0ad-0.0.23b-alpha/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h
--- 0ad-0.0.23b-alpha/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h.orig	2020-03-30 16:28:20.011982827 -0300
+++ 0ad-0.0.23b-alpha/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.h	2020-03-31 11:43:27.669098382 -0300
@@ -553,7 +553,16 @@ public:
 
 	static void WritePhysicsRigidBodyParameters(FCDPhysicsRigidBodyParameters* physicsRigidBodyParameters, xmlNode* techniqueNode);
 	template <class TYPE, int QUAL>
-	static xmlNode* AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT<TYPE,QUAL>& value);
+	static xmlNode* AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT<TYPE,QUAL>& value) {
+		xmlNode* paramNode = AddChild(parentNode, name);
+		AddContent(paramNode, FUStringConversion::ToString((TYPE&) value));
+		if (value.IsAnimated())
+		{
+			const FCDAnimated* animated = value.GetAnimated();
+			FArchiveXML::WriteAnimatedValue(animated, paramNode, name);
+		}
+		return paramNode;
+	}
 
 
 	//
diff -up 0ad-0.0.23b-alpha/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp.orig 0ad-0.0.23b-alpha/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp
--- 0ad-0.0.23b-alpha/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp.orig	2008-09-07 19:13:25.000000000 -0300
+++ 0ad-0.0.23b-alpha/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FAXPhysicsExport.cpp	2020-03-31 11:43:24.577115067 -0300
@@ -329,16 +329,3 @@ void FArchiveXML::WritePhysicsRigidBodyP
 		FArchiveXML::LetWriteObject(physicsRigidBodyParameters->GetPhysicsShape(i), techniqueNode);
 	}
 }
-
-template <class TYPE, int QUAL>
-xmlNode* FArchiveXML::AddPhysicsParameter(xmlNode* parentNode, const char* name, FCDParameterAnimatableT<TYPE,QUAL>& value)
-{
-	xmlNode* paramNode = AddChild(parentNode, name);
-	AddContent(paramNode, FUStringConversion::ToString((TYPE&) value));
-	if (value.IsAnimated())
-	{
-		const FCDAnimated* animated = value.GetAnimated();
-		FArchiveXML::WriteAnimatedValue(animated, paramNode, name);
-	}
-	return paramNode;
-}
openSUSE Build Service is sponsored by