diff options
author | Peter Powell <petpow@saberuk.com> | 2013-04-15 16:45:42 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-04-19 01:34:07 +0100 |
commit | 0d3a6719b8d924ea663f95e3e2fb834cbd80c6a5 (patch) | |
tree | d16a152c375232039ce2243145c57d3bb4aed525 /include | |
parent | 326852f7dd3fd6989d37ad2991f8a174b3a86b65 (diff) |
Fix building with libc++.
- Purged std::tr1::strlower (was never used).
- Moved std::tr1::insensitive to irc::insensitive.
- Added TR1NS macro to point to the correct C++ TR1 namespace.
Diffstat (limited to 'include')
-rw-r--r-- | include/bancache.h | 2 | ||||
-rw-r--r-- | include/dns.h | 2 | ||||
-rw-r--r-- | include/hashcomp.h | 23 | ||||
-rw-r--r-- | include/inspircd.h | 4 | ||||
-rw-r--r-- | include/typedefs.h | 6 |
5 files changed, 13 insertions, 24 deletions
diff --git a/include/bancache.h b/include/bancache.h index 450f711c4..7f51ca75e 100644 --- a/include/bancache.h +++ b/include/bancache.h @@ -51,7 +51,7 @@ class CoreExport BanCacheHit /* A container of ban cache items. * must be defined after class BanCacheHit. */ -typedef std::tr1::unordered_map<std::string, BanCacheHit*, std::tr1::hash<std::string> > BanCacheHash; +typedef TR1NS::unordered_map<std::string, BanCacheHit*, TR1NS::hash<std::string> > BanCacheHash; /** A manager for ban cache, which allocates and deallocates and checks cached bans. */ diff --git a/include/dns.h b/include/dns.h index d03af8918..120a8f428 100644 --- a/include/dns.h +++ b/include/dns.h @@ -101,7 +101,7 @@ class CoreExport CachedQuery /** DNS cache information. Holds IPs mapped to hostnames, and hostnames mapped to IPs. */ -typedef std::tr1::unordered_map<irc::string, CachedQuery, irc::hash> dnscache; +typedef TR1NS::unordered_map<irc::string, CachedQuery, irc::hash> dnscache; /** * Error types that class Resolver can emit to its error method. diff --git a/include/hashcomp.h b/include/hashcomp.h index e4b3cfe79..3c00844be 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -109,6 +109,11 @@ namespace irc bool operator()(const std::string& s1, const std::string& s2) const; }; + struct insensitive + { + size_t CoreExport operator()(const std::string &s) const; + }; + /** The irc_char_traits class is used for RFC-style comparison of strings. * This class is used to implement irc::string, a case-insensitive, RFC- * comparing string class. @@ -581,21 +586,3 @@ inline std::string& trim(std::string &str) return str; } - -namespace std -{ - namespace tr1 - { - - struct insensitive - { - size_t CoreExport operator()(const std::string &s) const; - }; - - /** Convert a string to lower case respecting RFC1459 - * @param n A string to lowercase - */ - void strlower(char *n); - - } -} diff --git a/include/inspircd.h b/include/inspircd.h index 929674eb3..25ef288aa 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -66,9 +66,11 @@ #include <unistd.h> #endif -#ifdef _WIN32 +#if defined _LIBCPP_VERSION || defined _WIN32 +# define TR1NS std # include <unordered_map> #else +# define TR1NS std::tr1 # include <tr1/unordered_map> #endif #include <sstream> diff --git a/include/typedefs.h b/include/typedefs.h index be7d4f796..b19426b6a 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -55,8 +55,8 @@ struct ResourceRecord; #include "hashcomp.h" #include "base.h" -typedef std::tr1::unordered_map<std::string, User*, std::tr1::insensitive, irc::StrHashComp> user_hash; -typedef std::tr1::unordered_map<std::string, Channel*, std::tr1::insensitive, irc::StrHashComp> chan_hash; +typedef TR1NS::unordered_map<std::string, User*, irc::insensitive, irc::StrHashComp> user_hash; +typedef TR1NS::unordered_map<std::string, Channel*, irc::insensitive, irc::StrHashComp> chan_hash; /** A list holding local users, this is the type of UserManager::local_users */ @@ -114,7 +114,7 @@ typedef std::map<std::string, file_cache> ConfigFileCache; /** A hash of commands used by the core */ -typedef std::tr1::unordered_map<std::string,Command*> Commandtable; +typedef TR1NS::unordered_map<std::string, Command*> Commandtable; /** Membership list of a channel */ typedef std::map<User*, Membership*> UserMembList; |