1 | /* |
---|
2 | * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> |
---|
3 | * |
---|
4 | * This program is free software; you can redistribute it and/or modify |
---|
5 | * it under the terms of the GNU General Public License as published by |
---|
6 | * the Free Software Foundation; either version 2 of the License, or |
---|
7 | * (at your option) any later version. |
---|
8 | * |
---|
9 | * This program is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
12 | * GNU General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU General Public License |
---|
15 | * along with this program; if not, write to the Free Software |
---|
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef MANGOS_HASHMAP_H |
---|
20 | #define MANGOS_HASHMAP_H |
---|
21 | |
---|
22 | #include "Platform/CompilerDefs.h" |
---|
23 | #include "Platform/Define.h" |
---|
24 | |
---|
25 | #if COMPILER == COMPILER_INTEL |
---|
26 | #include <ext/hash_map> |
---|
27 | #elif COMPILER == COMPILER_GNU && __GNUC__ >= 3 |
---|
28 | #include <ext/hash_map> |
---|
29 | #else |
---|
30 | #include <hash_map> |
---|
31 | #endif |
---|
32 | |
---|
33 | #ifdef _STLPORT_VERSION |
---|
34 | #define HM_NAMESPACE std |
---|
35 | using std::hash_map; |
---|
36 | #elif COMPILER == COMPILER_MICROSOFT && _MSC_VER >= 1300 |
---|
37 | #define HM_NAMESPACE stdext |
---|
38 | using stdext::hash_map; |
---|
39 | #elif COMPILER == COMPILER_INTEL |
---|
40 | #define HM_NAMESPACE std |
---|
41 | using std::hash_map; |
---|
42 | #elif COMPILER == COMPILER_GNU && __GNUC__ >= 3 |
---|
43 | #define HM_NAMESPACE __gnu_cxx |
---|
44 | using __gnu_cxx::hash_map; |
---|
45 | |
---|
46 | namespace __gnu_cxx |
---|
47 | { |
---|
48 | template<> struct hash<unsigned long long> |
---|
49 | { |
---|
50 | size_t operator()(const unsigned long long &__x) const { return (size_t)__x; } |
---|
51 | }; |
---|
52 | template<typename T> struct hash<T *> |
---|
53 | { |
---|
54 | size_t operator()(T * const &__x) const { return (size_t)__x; } |
---|
55 | }; |
---|
56 | |
---|
57 | }; |
---|
58 | |
---|
59 | #else |
---|
60 | #define HM_NAMESPACE std |
---|
61 | using std::hash_map; |
---|
62 | #endif |
---|
63 | #endif |
---|