diff options
author | Adam <Adam@anope.org> | 2011-04-08 03:48:43 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-04-10 17:54:20 -0400 |
commit | b56565eac2d7207c88c53054cb1096519ec7fba9 (patch) | |
tree | cd0f10a47dd002157553d96e2ef91ea5d620eadc /include | |
parent | f8588b112fe6ef1095e40fcd64f85e670d96bc92 (diff) |
Fixed Windows build on VS 2010
Diffstat (limited to 'include')
-rw-r--r-- | include/base.h | 5 | ||||
-rw-r--r-- | include/dns.h | 2 | ||||
-rw-r--r-- | include/hashcomp.h | 20 |
3 files changed, 15 insertions, 12 deletions
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 <typename T> -class reference +class CoreExport reference { T* value; public: @@ -141,8 +141,10 @@ class reference inline bool operator>(const reference<T>& 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<irc::string, CachedQuery, nspace::hash_compare<irc::string> > dnscache; #else -typedef nspace::hash_map<irc::string, CachedQuery, nspace::hash<irc::string> > dnscache; +typedef nspace::hash_map<irc::string, CachedQuery, irc::hash> 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<irc::string> - { - /** 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 |