diff options
author | Adam <Adam@anope.org> | 2013-03-01 00:57:24 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-03-01 00:57:24 -0500 |
commit | 91ad9d22cad8c1da3134975852ba1f732b55dabe (patch) | |
tree | f93eb451755e2e531c75d2c16ced8c96f17e243c | |
parent | 6aa9ad938a4923bd730516aa97a6e19643fd5c57 (diff) |
Fix Windows build
-rw-r--r-- | cmake/NSIS.template.in | 2 | ||||
-rw-r--r-- | include/anope.h | 46 | ||||
-rw-r--r-- | include/commands.h | 2 | ||||
-rw-r--r-- | include/defs.h | 1 | ||||
-rw-r--r-- | include/language.h | 10 | ||||
-rw-r--r-- | include/modes.h | 3 | ||||
-rw-r--r-- | include/modules.h | 2 | ||||
-rw-r--r-- | include/regchannel.h | 2 | ||||
-rw-r--r-- | include/sockets.h | 2 | ||||
-rw-r--r-- | modules/database/db_flatfile.cpp | 2 | ||||
-rw-r--r-- | modules/encryption/enc_old.cpp | 2 | ||||
-rw-r--r-- | modules/extra/dns.h | 4 | ||||
-rw-r--r-- | src/init.cpp | 2 | ||||
-rw-r--r-- | src/misc.cpp | 2 | ||||
-rw-r--r-- | src/win32/anope_windows.h | 4 |
15 files changed, 45 insertions, 41 deletions
diff --git a/cmake/NSIS.template.in b/cmake/NSIS.template.in index a9c91a2b7..b40e82761 100644 --- a/cmake/NSIS.template.in +++ b/cmake/NSIS.template.in @@ -525,7 +525,7 @@ FunctionEnd !insertmacro MUI_PAGE_INSTFILES - !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt" + !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.txt" !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM diff --git a/include/anope.h b/include/anope.h index 6878a333c..9bf0f982d 100644 --- a/include/anope.h +++ b/include/anope.h @@ -339,16 +339,16 @@ namespace Anope /** The time Anope started. */ - extern time_t StartTime; + extern CoreExport time_t StartTime; /** The value to return from main() */ extern int ReturnValue; extern sig_atomic_t Signal; - extern bool Quitting; - extern bool Restarting; - extern Anope::string QuitReason; + extern CoreExport bool Quitting; + extern CoreExport bool Restarting; + extern CoreExport Anope::string QuitReason; /** The current system time, which is pretty close to being accurate. * Use this unless you need very specific time checks @@ -357,31 +357,31 @@ namespace Anope /** The debug level we are running at. */ - extern int Debug; + extern CoreExport int Debug; /** Other comand line options. */ - extern bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug; + extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug; /** The root of the services installation. Usually ~/services */ - extern Anope::string ServicesDir; + extern CoreExport Anope::string ServicesDir; /** Services binary name (eg services) */ - extern Anope::string ServicesBin; + extern CoreExport Anope::string ServicesBin; /** Various directory paths. These can be set at runtime by command line args */ - extern Anope::string ConfigDir; - extern Anope::string DataDir; - extern Anope::string ModuleDir; - extern Anope::string LocaleDir; - extern Anope::string LogDir; + extern CoreExport Anope::string ConfigDir; + extern CoreExport Anope::string DataDir; + extern CoreExport Anope::string ModuleDir; + extern CoreExport Anope::string LocaleDir; + extern CoreExport Anope::string LogDir; /** The uplink we are currently connected to */ - extern int CurrentUplink; + extern CoreExport int CurrentUplink; /** Various methods to determine the Anope version running */ @@ -417,7 +417,7 @@ namespace Anope /** Calls the save database event */ - extern void SaveDatabases(); + extern CoreExport void SaveDatabases(); /** Check whether two strings match. * @param str The string to check against the pattern (e.g. foobar) @@ -457,7 +457,7 @@ namespace Anope * @param src The source string to encrypt * @param dest The destination where the encrypted string is placed */ - extern void Encrypt(const Anope::string &src, Anope::string &dest); + extern CoreExport void Encrypt(const Anope::string &src, Anope::string &dest); /** Decrypts what is in 'src' to 'dest'. * @param src The source string to decrypt @@ -465,7 +465,7 @@ namespace Anope * @return true if decryption was successful. This is usually not the case * as most encryption methods we use are one way. */ - extern bool Decrypt(const Anope::string &src, Anope::string &dest); + extern CoreExport bool Decrypt(const Anope::string &src, Anope::string &dest); /** Returns a sequence of data formatted as the format argument specifies. ** After the format parameter, the function expects at least as many @@ -488,40 +488,40 @@ namespace Anope /** Determines if a path is a file */ - extern bool IsFile(const Anope::string &file); + extern CoreExport bool IsFile(const Anope::string &file); /** Converts a string into seconds * @param s The string, eg 3d * @return The time represented by the string, eg 259,200 */ - extern time_t DoTime(const Anope::string &s); + extern CoreExport time_t DoTime(const Anope::string &s); /** Retrieves a human readable string representing the time in seconds * @param seconds The time on seconds, eg 60 * @param nc The account to use langauge settings for to translate this string, if applicable * @return A human readable string, eg "1 minute" */ - extern Anope::string Duration(time_t seconds, const NickCore *nc = NULL); + extern CoreExport Anope::string Duration(time_t seconds, const NickCore *nc = NULL); /** Generates a human readable string of type "expires in ..." * @param expires time in seconds * @param nc The account to use langauge settings for to translate this string, if applicable * @return A human readable string, eg "expires in 5 days" */ - extern Anope::string Expires(time_t seconds, const NickCore *nc = NULL); + extern CoreExport Anope::string Expires(time_t seconds, const NickCore *nc = NULL); /** Converts a time in seconds (epoch) to a human readable format. * @param t The time * @param nc The account to use langauge settings for to translate this string, if applicable * @param short_output If true, the output is just a date (eg, "Apr 12 20:18:22 2009 MSD"), else it includes the date and how long ago/from now that date is, (eg "Apr 12 20:18:22 2009 MSD (1313 days, 9 hours, 32 minutes ago)" */ - extern Anope::string strftime(time_t t, const NickCore *nc = NULL, bool short_output = false); + extern CoreExport Anope::string strftime(time_t t, const NickCore *nc = NULL, bool short_output = false); /** Normalize buffer, stripping control characters and colors * @param A string to be parsed for control and color codes * @return A string stripped of control and color codes */ - extern Anope::string NormalizeBuffer(const Anope::string &); + extern CoreExport Anope::string NormalizeBuffer(const Anope::string &); /** Main processing routine. Parses the message and takes the appropriate action. * @param Raw message from the uplink diff --git a/include/commands.h b/include/commands.h index 207d2c444..10ddeed2b 100644 --- a/include/commands.h +++ b/include/commands.h @@ -43,7 +43,7 @@ struct CommandInfo /* Where the replies from commands go to. User inheits from this and is the normal * source of a CommandReply */ -struct CommandReply +struct CoreExport CommandReply { virtual ~CommandReply() { } virtual void SendMessage(const BotInfo *source, const Anope::string &msg) = 0; diff --git a/include/defs.h b/include/defs.h index ee70d5a70..34e900717 100644 --- a/include/defs.h +++ b/include/defs.h @@ -13,6 +13,7 @@ class AccessGroup; class AutoKick; +namespace Anope { class String; } class BotInfo; class CallBack; class ChanAccess; diff --git a/include/language.h b/include/language.h index daa5aa6bf..42d95383d 100644 --- a/include/language.h +++ b/include/language.h @@ -16,7 +16,7 @@ namespace Language * added to this list if we detect a language exists in the correct * location for each language. */ - extern std::vector<Anope::string> Languages; + extern CoreExport std::vector<Anope::string> Languages; /* Domains to search when looking for translations other than the * default "anope domain. This is used by modules who add their own @@ -38,28 +38,28 @@ namespace Language * @param string A string to translate * @return The translated string if found, else the original string. */ - extern const char *Translate(const char *string); + extern CoreExport const char *Translate(const char *string); /** Translates a string to the language of the given user. * @param u The user to transate the string for * @param string A string to translate * @return The translated string if found, else the original string. */ - extern const char *Translate(User *u, const char *string); + extern CoreExport const char *Translate(User *u, const char *string); /** Translates a string to the language of the given account. * @param nc The account to translate the string for * @param string A string to translate * @return The translated string if count, else the original string */ - extern const char *Translate(const NickCore *nc, const char *string); + extern CoreExport const char *Translate(const NickCore *nc, const char *string); /** Translatesa string to the given language. * @param lang The language to trnalsate to * @param string The string to translate * @return The translated string if found, else the original string. */ - extern const char *Translate(const char *lang, const char *string); + extern CoreExport const char *Translate(const char *lang, const char *string); } // namespace Language diff --git a/include/modes.h b/include/modes.h index 5d884692e..4b207fa44 100644 --- a/include/modes.h +++ b/include/modes.h @@ -298,7 +298,8 @@ class CoreExport ModeManager static std::vector<UserMode *> UserModes; /* Number of generic channel and user modes we are tracking */ - static unsigned GenericChannelModes, GenericUserModes; + static unsigned GenericChannelModes; + static unsigned GenericUserModes; /* Default channel mode lock */ static std::list<std::pair<Anope::string, Anope::string> > ModeLockOn; static std::list<Anope::string> ModeLockOff; diff --git a/include/modules.h b/include/modules.h index 5bdce1355..53f723898 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1029,7 +1029,7 @@ class CoreExport ModuleManager public: /** List of all modules loaded in Anope */ - static CoreExport std::list<Module *> Modules; + static std::list<Module *> Modules; /** Event handler hooks. * This needs to be public to be used by FOREACH_MOD and friends. diff --git a/include/regchannel.h b/include/regchannel.h index ab369ce2b..c20f874e1 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -168,7 +168,7 @@ class CoreExport ChannelInfo : public Serializable, public Extensible public: friend class ChanAccess; friend class AutoKick; - friend class BadWord; + friend struct BadWord; typedef std::multimap<Anope::string, ModeLock *> ModeList; Serialize::Checker<ModeList> mode_locks; diff --git a/include/sockets.h b/include/sockets.h index 12cba7b7f..8fc675614 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -96,7 +96,7 @@ class CoreExport cidr bool operator==(const cidr &other) const; bool operator!=(const cidr &other) const; - struct hash + struct CoreExport hash { size_t operator()(const cidr &s) const; }; diff --git a/modules/database/db_flatfile.cpp b/modules/database/db_flatfile.cpp index 848356574..09fde3242 100644 --- a/modules/database/db_flatfile.cpp +++ b/modules/database/db_flatfile.cpp @@ -242,6 +242,7 @@ class DBFlatFile : public Module, public Pipe BackupDatabase(); int i = -1; +#ifndef _WIN32 if (use_fork) { i = fork(); @@ -250,6 +251,7 @@ class DBFlatFile : public Module, public Pipe else if (i < 0) Log(this) << "Unable to fork for database save"; } +#endif try { diff --git a/modules/encryption/enc_old.cpp b/modules/encryption/enc_old.cpp index 03debc65a..dad8bb91f 100644 --- a/modules/encryption/enc_old.cpp +++ b/modules/encryption/enc_old.cpp @@ -30,7 +30,7 @@ class OldMD5Provider : public Encryption::Provider { if (md5) return md5->GetDefaultIV(); - return Encryption::IV(NULL, 0); + return Encryption::IV(static_cast<const uint32_t *>(NULL), 0); } }; diff --git a/modules/extra/dns.h b/modules/extra/dns.h index 4eba1630c..469bb0e82 100644 --- a/modules/extra/dns.h +++ b/modules/extra/dns.h @@ -56,7 +56,7 @@ namespace DNS ERROR_NONE, ERROR_UNKNOWN, ERROR_UNLOADED, - ERROR_TIMEOUT, + ERROR_TIMEDOUT, ERROR_NOT_AN_ANSWER, ERROR_NONSTANDARD_QUERY, ERROR_FORMAT_ERROR, @@ -166,7 +166,7 @@ namespace DNS { Log(LOG_DEBUG_2) << "Resolver: timeout for query " << this->name; Query rr(*this); - rr.error = ERROR_TIMEOUT; + rr.error = ERROR_TIMEDOUT; this->OnError(&rr); } }; diff --git a/src/init.cpp b/src/init.cpp index a419c9f8d..7c6d1731d 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -189,7 +189,9 @@ static void InitSignals() sa.sa_handler = SIG_IGN; +#ifndef _WIN32 sigaction(SIGCHLD, &sa, NULL); +#endif sigaction(SIGPIPE, &sa, NULL); } diff --git a/src/misc.cpp b/src/misc.cpp index 18d737dbc..e9e5c68a3 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -23,8 +23,10 @@ #include <errno.h> #include <sys/types.h> #include <sys/stat.h> +#ifndef _WIN32 #include <sys/socket.h> #include <netdb.h> +#endif NumberList::NumberList(const Anope::string &list, bool descending) : is_valid(true), desc(descending) { diff --git a/src/win32/anope_windows.h b/src/win32/anope_windows.h index c0a2232a7..fdeb36fb1 100644 --- a/src/win32/anope_windows.h +++ b/src/win32/anope_windows.h @@ -52,8 +52,6 @@ #endif #define EINPROGRESS WSAEWOULDBLOCK -#include "extensible.h" - #include "socket.h" #include "dir/dir.h" #include "dl/dl.h" @@ -77,7 +75,5 @@ extern int unsetenv(const char *name); extern int mkstemp(char *input); extern void getcwd(char *buf, size_t sz); -template struct ExtensibleItemClass<Anope::string>; - #endif // _WIN32 #endif // WINDOWS_H |