InspIRCd  2.0
hash_map.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  * Copyright (C) 2009 Robin Burchell <[email protected]>
5  * Copyright (C) 2008 Craig Edwards <[email protected]>
6  * Copyright (C) 2007 Dennis Friis <[email protected]>
7  * Copyright (C) 2006 Oliver Lupton <[email protected]>
8  *
9  * This file is part of InspIRCd. InspIRCd is free software: you can
10  * redistribute it and/or modify it under the terms of the GNU General Public
11  * License as published by the Free Software Foundation, version 2.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #ifndef INSPIRCD_HASHMAP_H
24 #define INSPIRCD_HASHMAP_H
25 
32  #if !defined _LIBCPP_VERSION && !defined _WIN32
33  #if !defined __GLIBCXX__ || __GLIBCXX__ > 20060309
34  // GCC4+ has deprecated hash_map and uses tr1. But of course, uses a different include to MSVC. FOR FUCKS SAKE.
35  #include <tr1/unordered_map>
36  #define HAS_TR1_UNORDERED
37  #define HASHMAP_DEPRECATED
38  #define hash_map unordered_map
39  #define nspace std::tr1
40  #define BEGIN_HASHMAP_NAMESPACE namespace std { namespace tr1 {
41  #define END_HASHMAP_NAMESPACE } }
42  #else
43  #include <ext/hash_map>
45  #define nspace __gnu_cxx
46  #define BEGIN_HASHMAP_NAMESPACE namespace nspace {
47  #define END_HASHMAP_NAMESPACE }
48  #endif
49  #else
50  #include <unordered_map>
51  #define HAS_TR1_UNORDERED
52  #define HASHMAP_DEPRECATED
53  #define hash_map unordered_map
54  #define nspace std
55  #define BEGIN_HASHMAP_NAMESPACE namespace std {
56  #define END_HASHMAP_NAMESPACE }
57  #endif
58 
59 #endif