1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #ifndef INSPIRCD_HASHMAP_H
15 #define INSPIRCD_HASHMAP_H
17 /** Where hash_map is varies from compiler to compiler
18 * as it is not standard unless we have tr1.
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
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 }
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
40 /** Oddball windows namespace for hash_map */
41 using stdext::hash_map;
42 #define BEGIN_HASHMAP_NAMESPACE namespace nspace {
43 #define END_HASHMAP_NAMESPACE }
47 // tr1: restoring sanity to our headers. now if only compiler vendors could agree on a FUCKING INCLUDE FILE.
48 #ifdef HAS_TR1_UNORDERED
49 #define hash_map unordered_map
50 #define nspace std::tr1
51 #define BEGIN_HASHMAP_NAMESPACE namespace std { namespace tr1 {
52 #define END_HASHMAP_NAMESPACE } }