mirror of
https://github.com/vgough/encfs.git
synced 2025-02-22 20:51:18 +01:00
Replace check for GNU internal hashmap with std unordered_map.
This commit is contained in:
parent
98b2d50b40
commit
3b751dde57
@ -25,12 +25,8 @@
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#ifdef USE_HASHMAP
|
||||
#include <ext/hash_map>
|
||||
#else
|
||||
#include <map>
|
||||
#endif
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "encfs.h"
|
||||
#include "shared_ptr.h"
|
||||
@ -90,12 +86,7 @@ class EncFS_Context {
|
||||
Placeholder(const shared_ptr<FileNode> &ptr) : node(ptr) {}
|
||||
};
|
||||
|
||||
#ifdef USE_HASHMAP
|
||||
// set of open files, indexed by path
|
||||
typedef __gnu_cxx::hash_map<std::string, std::set<Placeholder *> > FileMap;
|
||||
#else
|
||||
typedef std::map<std::string, std::set<Placeholder *> > FileMap;
|
||||
#endif
|
||||
typedef std::unordered_map<std::string, std::set<Placeholder *> > FileMap;
|
||||
|
||||
mutable pthread_mutex_t contextMutex;
|
||||
FileMap openFiles;
|
||||
|
@ -76,17 +76,6 @@ class DirTraverse {
|
||||
};
|
||||
inline bool DirTraverse::valid() const { return dir.get() != 0; }
|
||||
|
||||
#ifdef USE_HASHMAP
|
||||
namespace __gnu_cxx {
|
||||
template <>
|
||||
struct hash<std::string> {
|
||||
size_t operator()(const std::string &__s) const {
|
||||
return __stl_hash_string(__s.c_str());
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
class DirNode {
|
||||
public:
|
||||
// sourceDir points to where raw files are stored
|
||||
|
Loading…
Reference in New Issue
Block a user