From a118946e657b8a137502ff60c1f21c608cb44495 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 May 2013 03:01:54 -0400 Subject: [PATCH] Fix Windows --- include/config.h | 23 +++++++++++++++-------- include/defs.h | 4 ++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/include/config.h b/include/config.h index 6fb1c244f..5d9005f63 100644 --- a/include/config.h +++ b/include/config.h @@ -21,9 +21,9 @@ namespace Configuration { - class Block + class CoreExport Block { - friend class Conf; + friend struct Conf; public: typedef Anope::map item_map; @@ -40,7 +40,14 @@ namespace Configuration int CountBlock(const Anope::string &name); Block* GetBlock(const Anope::string &name, int num = 0); - template T Get(const Anope::string &tag, const Anope::string &def = "") const + template inline T Get(const Anope::string &tag) + { + return this->Get(tag, ""); + } + /* VS 2008 has an issue with having a default argument here (def = ""), which is why the above + * function exists. + */ + template T Get(const Anope::string &tag, const Anope::string &def) const { const Anope::string &value = this->Get(tag, def); try @@ -57,10 +64,10 @@ namespace Configuration const item_map* GetItems() const; }; - template<> const Anope::string& Block::Get(const Anope::string &tag, const Anope::string& def) const; - template<> time_t Block::Get(const Anope::string &tag, const Anope::string &def) const; - template<> const char* Block::Get(const Anope::string &tag, const Anope::string &def) const; - template<> bool Block::Get(const Anope::string &tag, const Anope::string &def) const; + template<> CoreExport const Anope::string& Block::Get(const Anope::string &tag, const Anope::string& def) const; + template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const; + template<> CoreExport const char* Block::Get(const Anope::string &tag, const Anope::string &def) const; + template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const; /** Represents a configuration file */ @@ -83,7 +90,7 @@ namespace Configuration struct Uplink; - struct Conf : Block + struct CoreExport Conf : Block { /* options:readtimeout */ time_t ReadTimeout; diff --git a/include/defs.h b/include/defs.h index 9521c760a..e1c7613bc 100644 --- a/include/defs.h +++ b/include/defs.h @@ -23,9 +23,9 @@ struct ChanUserContainer; class ClientSocket; class Command; class CommandSource; -namespace Configuration { class Conf; } +namespace Configuration { struct Conf; } class ConnectionSocket; -namespace DNS { class Query; } +namespace DNS { struct Query; } class Entry; class IdentifyRequest; class InfoFormatter;