From 54d69ea3e123b20303871b0179599f92a39aafdf Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Tue, 7 Aug 2012 19:31:23 +0200 Subject: Extract hash map hack from rw-task-fair.cpp Hashmaps will be needed by the LP code. Additionally, add definitions for hash maps with uint64_t keys. This is only relevant for legacy C++ libs as used on Mac OS X. On Linux, we use the newer C++ '11 STL implementation. --- native/include/stl-hashmap.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 native/include/stl-hashmap.h (limited to 'native/include') diff --git a/native/include/stl-hashmap.h b/native/include/stl-hashmap.h new file mode 100644 index 0000000..2276a4d --- /dev/null +++ b/native/include/stl-hashmap.h @@ -0,0 +1,35 @@ +#ifndef STL_HASHMAP_H_ +#define STL_HASHMAP_H_ + +#ifdef CONFIG_USE_0X +#include +#define hashmap std::unordered_map +#else +#include + +namespace __gnu_cxx +{ +template<> +struct hash +{ + size_t operator()(long long int __x) const + { + return __x; + } +}; + +template<> +struct hash +{ + size_t operator()(unsigned long long int __x) const + { + return __x; + } +}; + +}; + +#define hashmap __gnu_cxx::hash_map +#endif + +#endif -- cgit v1.2.2