From 8e6fe991810985fea085a4ace0ee906e80e7cbd1 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 30 Jul 2010 01:11:19 -0400 Subject: Fixed some Windows issues with hashing and sockets. This currently limits building to VS 2010, will look at 2008 later --- include/hashcomp.h | 22 ++++++++++------------ include/socketengine.h | 8 ++++++-- include/users.h | 4 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) (limited to 'include') 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 -# define unordered_map_namespace std::tr1 -# else -# include -# define unordered_map_namespace stdext -# define unordered_map hash_map -# endif +# include +# define unordered_map_namespace std::tr1 #endif /******************************************************* @@ -247,8 +241,9 @@ namespace std /** An overload for std::equal_to that uses Anope::string, passed for the fourth temmplate * argument for unordered_map */ - template<> struct equal_to + template<> class CoreExport equal_to { + 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 that uses Anope::string, passed for the fourth template * argument for unorderd_map */ - template<> struct equal_to + template<> class CoreExport equal_to { + 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 that uses Anope::string, passed for the third template argument * to std::map and std::multimap */ - template<> struct less + template<> class CoreExport less { + 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 that uses Anope::string, passed for the third tempalte argument * to std::map and std::multimap */ - template<> struct less + template<> class CoreExport less { + 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 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 > user_map; -typedef unordered_map_namespace::unordered_map > user_uid_map; +typedef unordered_map_namespace::unordered_map > user_map; +typedef unordered_map_namespace::unordered_map user_uid_map; extern CoreExport user_map UserListByNick; extern CoreExport user_uid_map UserListByUID; -- cgit