From b56565eac2d7207c88c53054cb1096519ec7fba9 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 8 Apr 2011 03:48:43 -0400 Subject: Fixed Windows build on VS 2010 --- include/base.h | 5 ++++- include/dns.h | 2 +- include/hashcomp.h | 20 ++++++++++---------- 3 files changed, 15 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/base.h b/include/base.h index 7926779eb..385907887 100644 --- a/include/base.h +++ b/include/base.h @@ -112,7 +112,7 @@ class CoreExport usecountbase }; template -class reference +class CoreExport reference { T* value; public: @@ -141,8 +141,10 @@ class reference inline bool operator>(const reference& other) const { return value > other.value; } static inline void* operator new(size_t, void* m) { return m; } private: +#ifndef WIN32 static void* operator new(size_t); static void operator delete(void*); +#endif }; /** This class can be used on its own to represent an exception, or derived to represent a module-specific exception. @@ -189,6 +191,7 @@ class CoreExport CoreException : public std::exception } }; +class Module; class CoreExport ModuleException : public CoreException { public: diff --git a/include/dns.h b/include/dns.h index 528490015..b22a2032e 100644 --- a/include/dns.h +++ b/include/dns.h @@ -97,7 +97,7 @@ class CoreExport CachedQuery #if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED) typedef nspace::hash_map > dnscache; #else -typedef nspace::hash_map > dnscache; +typedef nspace::hash_map dnscache; #endif /** diff --git a/include/hashcomp.h b/include/hashcomp.h index bb3321161..07ec49a66 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -92,7 +92,7 @@ namespace irc * Case sensitivity is ignored, and the RFC 'character set' * is adhered to */ - struct StrHashComp + struct CoreExport StrHashComp { /** The operator () does the actual comparison in hash_map */ @@ -479,6 +479,15 @@ namespace irc * @return The new value with _ translated to space. */ CoreExport const char* Spacify(const char* n); + + struct hash + { + /** Hash an irc::string using RFC1459 case sensitivity rules + * @param s A string to hash + * @return The hash value + */ + size_t CoreExport operator()(const irc::string &s) const; + }; } /* Define operators for using >> and << with irc::string to an ostream on an istream. */ @@ -622,15 +631,6 @@ BEGIN_HASHMAP_NAMESPACE }; #else - template<> struct hash - { - /** Hash an irc::string using RFC1459 case sensitivity rules - * @param s A string to hash - * @return The hash value - */ - size_t CoreExport operator()(const irc::string &s) const; - }; - /* XXX FIXME: Implement a hash function overriding std::string's that works with TR1! */ #ifdef HASHMAP_DEPRECATED -- cgit v1.2.3