1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 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 #include "inspircd_config.h"
19 /** Where hash_map is varies from compiler to compiler
20 * as it is not standard unless we have tr1.
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
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 }
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
41 /** Oddball windows namespace for hash_map */
44 using stdext::hash_map;
45 #define BEGIN_HASHMAP_NAMESPACE namespace nspace {
46 #define END_HASHMAP_NAMESPACE }
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 } }