]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/hash_map.h
More CoreExport, brought the errors down, but some still persist.
[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 #include "inspircd_config.h"
18
19         /** Where hash_map is varies from compiler to compiler
20          * as it is not standard unless we have tr1.
21          */
22         #ifndef WIN32
23                 #ifdef HASHMAP_DEPRECATED
24                         // GCC4+ has deprecated hash_map and uses tr1. But of course, uses a different include to MSVC. FOR FUCKS SAKE.
25                         #include <tr1/unordered_map>
26                         #define HAS_TR1_UNORDERED
27                 #else
28                         #include <ext/hash_map>
29                         /** Oddball linux namespace for hash_map */
30                         #define nspace __gnu_cxx
31                         #define BEGIN_HASHMAP_NAMESPACE namespace nspace {
32                         #define END_HASHMAP_NAMESPACE }
33                 #endif
34         #else
35                 #if _MSC_VER >= 1600
36                         // New MSVC has tr1. Just to make things fucked up, though, MSVC and GCC use different includes! FFS.
37                         #include <unordered_map>
38                         #define HAS_TR1_UNORDERED
39                         #define HASHMAP_DEPRECATED
40                 #else
41                         /** Oddball windows namespace for hash_map */
42                         #include <hash_map>
43                         #define nspace stdext
44                         using stdext::hash_map;
45                         #define BEGIN_HASHMAP_NAMESPACE namespace nspace {
46                         #define END_HASHMAP_NAMESPACE }
47                 #endif
48         #endif
49
50         // tr1: restoring sanity to our headers. now if only compiler vendors could agree on a FUCKING INCLUDE FILE.
51         #ifdef HAS_TR1_UNORDERED
52                 #define hash_map unordered_map
53                 #define nspace std::tr1
54                 #define BEGIN_HASHMAP_NAMESPACE namespace std { namespace tr1 {
55                 #define END_HASHMAP_NAMESPACE } }
56         #endif
57
58 #endif