1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Improve Mac wx3.1.1 compatibility

1. Qualify hash as std::hash.
2. Ensure we have a header for the function 'free'
This commit is contained in:
James Crook
2018-04-12 19:51:38 +01:00
parent dc7d3f9414
commit effab49a6f
4 changed files with 17 additions and 2 deletions

View File

@@ -103,7 +103,6 @@ namespace std
#ifdef __AUDACITY_OLD_STD__
namespace tr1
{
#endif
template<typename T> struct hash;
template<> struct hash< NormalizedKeyString > {
size_t operator () (const NormalizedKeyString &str) const // noexcept
@@ -113,8 +112,17 @@ namespace std
return Hasher{}( stdstr );
}
};
#ifdef __AUDACITY_OLD_STD__
}
#else
// in std, not in tr1.
template<> struct hash< NormalizedKeyString > {
size_t operator () (const NormalizedKeyString &str) const // noexcept
{
auto &stdstr = str.Raw(); // no allocations, a cheap fetch
using Hasher = std::hash< wxString >;
return Hasher{}( stdstr );
}
};
#endif
}