diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-08-07 13:31:23 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-12 06:49:39 -0500 |
| commit | 54d69ea3e123b20303871b0179599f92a39aafdf (patch) | |
| tree | 78fe74859862d425dd5fca859771ced1f6b79393 /native/include | |
| parent | 9eb76ebd3e970c3e37ce95ec6e21242a3b0ee0e4 (diff) | |
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.
Diffstat (limited to 'native/include')
| -rw-r--r-- | native/include/stl-hashmap.h | 35 |
1 files changed, 35 insertions, 0 deletions
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 @@ | |||
| 1 | #ifndef STL_HASHMAP_H_ | ||
| 2 | #define STL_HASHMAP_H_ | ||
| 3 | |||
| 4 | #ifdef CONFIG_USE_0X | ||
| 5 | #include <unordered_map> | ||
| 6 | #define hashmap std::unordered_map | ||
| 7 | #else | ||
| 8 | #include <ext/hash_map> | ||
| 9 | |||
| 10 | namespace __gnu_cxx | ||
| 11 | { | ||
| 12 | template<> | ||
| 13 | struct hash<long long int> | ||
| 14 | { | ||
| 15 | size_t operator()(long long int __x) const | ||
| 16 | { | ||
| 17 | return __x; | ||
| 18 | } | ||
| 19 | }; | ||
| 20 | |||
| 21 | template<> | ||
| 22 | struct hash<unsigned long long int> | ||
| 23 | { | ||
| 24 | size_t operator()(unsigned long long int __x) const | ||
| 25 | { | ||
| 26 | return __x; | ||
| 27 | } | ||
| 28 | }; | ||
| 29 | |||
| 30 | }; | ||
| 31 | |||
| 32 | #define hashmap __gnu_cxx::hash_map | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #endif | ||
