Permalink
Browse files

Fix Windows build

  • Loading branch information...
1 parent 6aa9ad9 commit 91ad9d22cad8c1da3134975852ba1f732b55dabe @Adam- Adam- committed Mar 1, 2013
View
@@ -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
View
@@ -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,15 +457,15 @@ 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
* @param dest The destination where the decrypted string is placed
* @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
View
@@ -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;
View
@@ -13,6 +13,7 @@
class AccessGroup;
class AutoKick;
+namespace Anope { class String; }
class BotInfo;
class CallBack;
class ChanAccess;
View
@@ -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
View
@@ -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;
View
@@ -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.
View
@@ -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;
View
@@ -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;
};
@@ -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
{
@@ -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);
}
};
View
@@ -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);
}
};
View
@@ -189,7 +189,9 @@ static void InitSignals()
sa.sa_handler = SIG_IGN;
+#ifndef _WIN32
sigaction(SIGCHLD, &sa, NULL);
+#endif
sigaction(SIGPIPE, &sa, NULL);
}
View
@@ -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)
{
@@ -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

0 comments on commit 91ad9d2

Please sign in to comment.