]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/hash_map.h
Remove unneeded Extensible inheritance and remove "age" field from classbase
[user/henk/code/inspircd.git] / include / hash_map.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14         #ifndef INSPIRCD_HASHMAP_H
15         #define INSPIRCD_HASHMAP_H
16
17         /** Where hash_map is varies from compiler to compiler
18          * as it is not standard unless we have tr1.
19          */
20         #ifndef WIN32
21                 #ifdef HASHMAP_DEPRECATED
22                         // GCC4+ has deprecated hash_map and uses tr1. But of course, uses a different include to MSVC. FOR FUCKS SAKE.
23                         #include <tr1/unordered_map>
24                         #define HAS_TR1_UNORDERED
25                 #else
26                         #include <ext/hash_map>
27                         /** Oddball linux namespace for hash_map */
28                         #define nspace __gnu_cxx
29                         #define BEGIN_HASHMAP_NAMESPACE namespace nspace {
30                         #define END_HASHMAP_NAMESPACE }
31                 #endif
32         #else
33                 #if _MSC_VER >= 1600
34                         // New MSVC has tr1. Just to make things fucked up, though, MSVC and GCC use different includes! FFS.
35                         #include <unordered_map>
36                         #define HAS_TR1_UNORDERED
37                         #define HASHMAP_DEPRECATED
38                 #else
39                         /** Oddball windows namespace for hash_map */
40                         #include <hash_map>
41                         #define nspace stdext
42                         using stdext::hash_map;
43                         #define BEGIN_HASHMAP_NAMESPACE namespace nspace {
44                         #define END_HASHMAP_NAMESPACE }
45                 #endif
46         #endif
47
48         // tr1: restoring sanity to our headers. now if only compiler vendors could agree on a FUCKING INCLUDE FILE.
49         #ifdef HAS_TR1_UNORDERED
50                 #define hash_map unordered_map
51                 #define nspace std::tr1
52                 #define BEGIN_HASHMAP_NAMESPACE namespace std { namespace tr1 {
53                 #define END_HASHMAP_NAMESPACE } }
54         #endif
55
56 #endif