diff options
author | Adam <Adam@anope.org> | 2010-07-30 01:11:19 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-07-30 01:11:19 -0400 |
commit | 8e6fe991810985fea085a4ace0ee906e80e7cbd1 (patch) | |
tree | 2d171628f4a510df780f32ae46ccc8c262086560 /include | |
parent | e353b15df8a5bcbf2de37ac4e2acf9e2812283e4 (diff) |
Fixed some Windows issues with hashing and sockets. This currently limits building to VS 2010, will look at 2008 later
Diffstat (limited to 'include')
-rw-r--r-- | include/hashcomp.h | 22 | ||||
-rw-r--r-- | include/socketengine.h | 8 | ||||
-rw-r--r-- | include/users.h | 4 |
3 files changed, 18 insertions, 16 deletions
diff --git a/include/hashcomp.h b/include/hashcomp.h index abf29a400..77e3c0439 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -45,15 +45,9 @@ namespace Anope # define unordered_map hash_map # endif #else -# if _MSV_VER >= 1600 /* MSVC 2010+ has tr1. Though MSVC and GCC use different includes! */ -# include <unordered_map> -# define unordered_map_namespace std::tr1 -# else -# include <hash_map> -# define unordered_map_namespace stdext -# define unordered_map hash_map -# endif +# include <unordered_map> +# define unordered_map_namespace std::tr1 #endif /******************************************************* @@ -247,8 +241,9 @@ namespace std /** An overload for std::equal_to<ci::string> that uses Anope::string, passed for the fourth temmplate * argument for unordered_map */ - template<> struct equal_to<ci::string> + template<> class CoreExport equal_to<ci::string> { + public: /** Compare two Anope::strings as ci::strings * @paarm s1 The first string * @param s2 The second string @@ -260,8 +255,9 @@ namespace std /** An overload for std::equal_to<irc::string> that uses Anope::string, passed for the fourth template * argument for unorderd_map */ - template<> struct equal_to<irc::string> + template<> class CoreExport equal_to<irc::string> { + public: /** Compare two Anope::strings as irc::strings * @param s1 The first string * @param s2 The second string @@ -273,8 +269,9 @@ namespace std /** An overload for std::less<ci::string> that uses Anope::string, passed for the third template argument * to std::map and std::multimap */ - template<> struct less<ci::string> + template<> class CoreExport less<ci::string> { + public: /** Compare two Anope::strings as ci::strings and find which one is less * @param s1 The first string * @param s2 The second string @@ -286,8 +283,9 @@ namespace std /** An overload for std;:less<irc::string> that uses Anope::string, passed for the third tempalte argument * to std::map and std::multimap */ - template<> struct less<irc::string> + template<> class CoreExport less<irc::string> { + public: /** Compare two Anope::strings as irc::strings and find which one is less * @param s1 The first string * @param s2 The second string diff --git a/include/socketengine.h b/include/socketengine.h index 042d4b410..7279ba3ad 100644 --- a/include/socketengine.h +++ b/include/socketengine.h @@ -15,16 +15,20 @@ class CoreExport SocketEngineBase { public: +#ifdef _WIN32 + /* Windows crap */ + WSADATA wsa; +#endif /* Map of sockets */ std::map<int, Socket *> Sockets; /** Default constructor */ - SocketEngineBase() { } + SocketEngineBase(); /** Default destructor */ - virtual ~SocketEngineBase() { } + virtual ~SocketEngineBase(); /** Add a socket to the internal list * @param s The socket diff --git a/include/users.h b/include/users.h index f545c15a1..2c10690c4 100644 --- a/include/users.h +++ b/include/users.h @@ -11,8 +11,8 @@ /* Hash maps used for users. Note UserListByUID will not be used on non-TS6 IRCds, and should never * be assumed to have users */ -typedef unordered_map_namespace::unordered_map<Anope::string, User *, ci::hash, std::less<ci::string> > user_map; -typedef unordered_map_namespace::unordered_map<Anope::string, User *, ci::hash, std::less<ci::string> > user_uid_map; +typedef unordered_map_namespace::unordered_map<Anope::string, User *, ci::hash, std::equal_to<ci::string> > user_map; +typedef unordered_map_namespace::unordered_map<Anope::string, User *, Anope::hash> user_uid_map; extern CoreExport user_map UserListByNick; extern CoreExport user_uid_map UserListByUID; |