From ca790f7320c9fc6c43e8c6022c9e511a85fd1c9d Mon Sep 17 00:00:00 2001
From: Kitty Barnett <develop@catznip.com>
Date: Tue, 18 Dec 2012 21:52:41 +0100
Subject: [PATCH] Bypass GCC template stumble by specializing getMaterialField
 for LLUUID

---
 indra/llprimitive/llmaterial.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index 982136128e4..645fcf7b46e 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -76,6 +76,17 @@ template<typename T> T getMaterialField(const LLSD& data, const std::string& fie
 	return (T)LLSD();
 }
 
+// GCC didn't like the generic form above for some reason
+template<> LLUUID getMaterialField(const LLSD& data, const std::string& field, const LLSD::Type field_type)
+{
+	if ( (data.has(field)) && (field_type == data[field].type()) )
+	{
+		return data[field].asUUID();
+	}
+	llerrs << "Missing or mistyped field '" << field << "' in material definition" << llendl;
+	return LLUUID::null;
+}
+
 /**
  * LLMaterial class
  */
-- 
GitLab