mirror of
https://github.com/vgough/encfs.git
synced 2025-02-23 05:01:38 +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 <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#ifdef USE_HASHMAP
|
|
||||||
#include <ext/hash_map>
|
|
||||||
#else
|
|
||||||
#include <map>
|
|
||||||
#endif
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "encfs.h"
|
#include "encfs.h"
|
||||||
#include "shared_ptr.h"
|
#include "shared_ptr.h"
|
||||||
@ -90,12 +86,7 @@ class EncFS_Context {
|
|||||||
Placeholder(const shared_ptr<FileNode> &ptr) : node(ptr) {}
|
Placeholder(const shared_ptr<FileNode> &ptr) : node(ptr) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_HASHMAP
|
typedef std::unordered_map<std::string, std::set<Placeholder *> > FileMap;
|
||||||
// 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
|
|
||||||
|
|
||||||
mutable pthread_mutex_t contextMutex;
|
mutable pthread_mutex_t contextMutex;
|
||||||
FileMap openFiles;
|
FileMap openFiles;
|
||||||
|
@ -76,17 +76,6 @@ class DirTraverse {
|
|||||||
};
|
};
|
||||||
inline bool DirTraverse::valid() const { return dir.get() != 0; }
|
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 {
|
class DirNode {
|
||||||
public:
|
public:
|
||||||
// sourceDir points to where raw files are stored
|
// sourceDir points to where raw files are stored
|
||||||
|
Loading…
Reference in New Issue
Block a user