changing ext/hash_(set|map) to unordered_(set|map) to avoid deprecation warning on mac.

This commit is contained in:
Thomas Ferreira de Lima 2018-08-01 14:56:58 -04:00
parent 568035cdd6
commit f6d3995d6b
No known key found for this signature in database
GPG Key ID: 43E98870EAA0A86E
1 changed files with 22 additions and 11 deletions

View File

@ -23,17 +23,21 @@
#ifndef HDR_dbHash
#define HDR_dbHash
#if defined(__GNUC__)
# include <ext/hash_map>
# include <ext/hash_set>
namespace std_ext = __gnu_cxx;
# define DB_HASH_NAMESPACE __gnu_cxx
#else
# include <hash_map>
# include <hash_set>
#if defined(__APPLE__) // clang compiler complains about deprecation warning on ext/hash_map and ext/hash_set
# include <unordered_map>
# include <unordered_set>
# define DB_HASH_NAMESPACE std
namespace std_ext = std;
# define DB_HASH_NAMESPACE std
#elif defined(__GNUC__)
# include <ext/hash_map>
# include <ext/hash_set>
namespace std_ext = __gnu_cxx;
# define DB_HASH_NAMESPACE __gnu_cxx
#else
# include <hash_map>
# include <hash_set>
namespace std_ext = std;
# define DB_HASH_NAMESPACE std
#endif
#include "dbPoint.h"
@ -74,7 +78,7 @@ namespace DB_HASH_NAMESPACE
};
#endif
#if defined(_WIN64) || defined(__APPLE__)
#if defined(_WIN64)
/**
* @brief Specialization missing for long long on WIN64
*/
@ -100,6 +104,13 @@ namespace DB_HASH_NAMESPACE
};
#endif
#if defined(__APPLE__)
template<typename _Key, typename _Tp>
using hash_map = unordered_map<_Key, _Tp>;
template<typename _Value>
using hash_set = unordered_set<_Value>;
#endif
template <class T>
inline size_t hfunc (const T &t)
{