From 0d3a6719b8d924ea663f95e3e2fb834cbd80c6a5 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 15 Apr 2013 16:45:42 +0100 Subject: 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. --- include/bancache.h | 2 +- include/dns.h | 2 +- include/hashcomp.h | 23 +++++------------------ include/inspircd.h | 4 +++- include/typedefs.h | 6 +++--- 5 files changed, 13 insertions(+), 24 deletions(-) (limited to 'include') 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 > BanCacheHash; +typedef TR1NS::unordered_map > 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 dnscache; +typedef TR1NS::unordered_map 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 #endif -#ifdef _WIN32 +#if defined _LIBCPP_VERSION || defined _WIN32 +# define TR1NS std # include #else +# define TR1NS std::tr1 # include #endif #include 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 user_hash; -typedef std::tr1::unordered_map chan_hash; +typedef TR1NS::unordered_map user_hash; +typedef TR1NS::unordered_map chan_hash; /** A list holding local users, this is the type of UserManager::local_users */ @@ -114,7 +114,7 @@ typedef std::map ConfigFileCache; /** A hash of commands used by the core */ -typedef std::tr1::unordered_map Commandtable; +typedef TR1NS::unordered_map Commandtable; /** Membership list of a channel */ typedef std::map UserMembList; -- cgit v1.3.1-10-gc9f91