2007-07-16 17:30:04 +00:00
|
|
|
/* +------------------------------------+
|
|
|
|
* | Inspire Internet Relay Chat Daemon |
|
|
|
|
* +------------------------------------+
|
|
|
|
*
|
2010-01-11 03:07:32 +00:00
|
|
|
* InspIRCd: (C) 2002-2010 InspIRCd Development Team
|
2009-03-15 12:42:35 +00:00
|
|
|
* See: http://wiki.inspircd.org/Credits
|
2007-07-16 17:30:04 +00:00
|
|
|
*
|
|
|
|
* This program is free but copyrighted software; see
|
|
|
|
* the file COPYING for details.
|
|
|
|
*
|
|
|
|
* ---------------------------------------------------
|
|
|
|
*/
|
2009-02-14 21:14:36 +00:00
|
|
|
|
2009-09-02 15:37:31 +00:00
|
|
|
#ifndef INSPIRCD_HASHMAP_H
|
|
|
|
#define INSPIRCD_HASHMAP_H
|
|
|
|
|
|
|
|
#include "inspircd_config.h"
|
2007-07-16 17:30:04 +00:00
|
|
|
|
2009-08-15 11:32:49 +00:00
|
|
|
/** Where hash_map is varies from compiler to compiler
|
|
|
|
* as it is not standard unless we have tr1.
|
|
|
|
*/
|
|
|
|
#ifndef WIN32
|
|
|
|
#ifdef HASHMAP_DEPRECATED
|
|
|
|
// GCC4+ has deprecated hash_map and uses tr1. But of course, uses a different include to MSVC. FOR FUCKS SAKE.
|
|
|
|
#include <tr1/unordered_map>
|
|
|
|
#define HAS_TR1_UNORDERED
|
|
|
|
#else
|
|
|
|
#include <ext/hash_map>
|
|
|
|
/** Oddball linux namespace for hash_map */
|
|
|
|
#define nspace __gnu_cxx
|
|
|
|
#define BEGIN_HASHMAP_NAMESPACE namespace nspace {
|
|
|
|
#define END_HASHMAP_NAMESPACE }
|
|
|
|
#endif
|
2008-06-12 17:40:40 +00:00
|
|
|
#else
|
2009-08-15 11:32:49 +00:00
|
|
|
#if _MSC_VER >= 1600
|
|
|
|
// New MSVC has tr1. Just to make things fucked up, though, MSVC and GCC use different includes! FFS.
|
|
|
|
#include <unordered_map>
|
|
|
|
#define HAS_TR1_UNORDERED
|
|
|
|
#define HASHMAP_DEPRECATED
|
|
|
|
#else
|
|
|
|
/** Oddball windows namespace for hash_map */
|
2009-08-26 17:57:44 +00:00
|
|
|
#include <hash_map>
|
|
|
|
#define nspace stdext
|
2009-08-15 11:32:49 +00:00
|
|
|
using stdext::hash_map;
|
|
|
|
#define BEGIN_HASHMAP_NAMESPACE namespace nspace {
|
|
|
|
#define END_HASHMAP_NAMESPACE }
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// tr1: restoring sanity to our headers. now if only compiler vendors could agree on a FUCKING INCLUDE FILE.
|
|
|
|
#ifdef HAS_TR1_UNORDERED
|
2008-06-12 17:40:40 +00:00
|
|
|
#define hash_map unordered_map
|
|
|
|
#define nspace std::tr1
|
2008-06-12 18:17:28 +00:00
|
|
|
#define BEGIN_HASHMAP_NAMESPACE namespace std { namespace tr1 {
|
2009-02-14 21:14:36 +00:00
|
|
|
#define END_HASHMAP_NAMESPACE } }
|
2008-06-12 17:40:40 +00:00
|
|
|
#endif
|
2007-07-16 17:30:04 +00:00
|
|
|
|
|
|
|
#endif
|