1
0
forked from 0ad/0ad

Fix build with old Boost

This was SVN commit r11427.
This commit is contained in:
Ykkrosh 2012-04-04 11:48:07 +00:00
parent e686c65fe6
commit 6d57808b84

View File

@ -94,9 +94,15 @@ static CStrInternInternals* GetString(const char* str, size_t len)
// to be thread-safe, preferably without sacrificing performance.)
ENSURE(ThreadUtil::IsMainThread());
#if BOOST_VERSION >= 104200
StringsKeyProxy proxy = { str, len };
boost::unordered_map<StringsKey, shared_ptr<CStrInternInternals> >::iterator it =
g_Strings.find(proxy, StringsKeyProxyHash(), StringsKeyProxyEq());
#else
// Boost <= 1.41 doesn't support the new find(), so do a slightly less efficient lookup
boost::unordered_map<StringsKey, shared_ptr<CStrInternInternals> >::iterator it =
g_Strings.find(str);
#endif
if (it != g_Strings.end())
return it->second.get();