Bypass GCC template stumble by specializing getMaterialField for LLUUID

master
Kitty Barnett 2012-12-18 21:52:41 +01:00
parent 5824e60c59
commit ca790f7320
1 changed files with 11 additions and 0 deletions

View File

@ -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
*/