diff options
author | Kitty Barnett <develop@catznip.com> | 2012-12-18 21:52:41 +0100 |
---|---|---|
committer | Kitty Barnett <develop@catznip.com> | 2012-12-18 21:52:41 +0100 |
commit | ca790f7320c9fc6c43e8c6022c9e511a85fd1c9d (patch) | |
tree | c030d4a43eb8224eddd3818ddc03c4610f390c92 /indra | |
parent | 5824e60c595a3004ba24c250cad72a5eace8013f (diff) |
Bypass GCC template stumble by specializing getMaterialField for LLUUID
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llprimitive/llmaterial.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 982136128e..645fcf7b46 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 */ |