From c5b9eaeda030638a6fbd59396f7ad61baaf70fad Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Wed, 26 Nov 2008 01:41:39 +0000 Subject: Various fixes for compiling under Windows. Also updated ms_* modules to use std::vector Memo struct from earlier commit. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1797 5417fbe8-f217-4b02-8779-1006273d7864 --- include/bots.h | 2 +- include/configreader.h | 2 +- include/modules.h | 6 +++--- include/services.h | 18 +++++++++++++----- include/sockets.h | 1 + include/users.h | 2 +- 6 files changed, 20 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/bots.h b/include/bots.h index 73941fbc4..7b175d99f 100644 --- a/include/bots.h +++ b/include/bots.h @@ -15,7 +15,7 @@ * --lara */ -class BotInfo +class CoreExport BotInfo { public: BotInfo *next, *prev; diff --git a/include/configreader.h b/include/configreader.h index 89b28e672..d7786e11d 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -420,7 +420,7 @@ class ConfigException : public std::exception * Constructing the class using one parameter allows you to specify a path to your own configuration * file, otherwise, inspircd.conf is read. */ -class ConfigReader +class CoreExport ConfigReader { protected: /** The contents of the configuration file diff --git a/include/modules.h b/include/modules.h index 524b23e1a..fc7451b49 100644 --- a/include/modules.h +++ b/include/modules.h @@ -150,7 +150,7 @@ struct ModuleLang_ { /** Every module in Anope is actually a class. */ -CoreExport class Module +class CoreExport Module { private: bool permanent; @@ -163,7 +163,7 @@ CoreExport class Module */ std::string filename; - void *handle; + ano_module_t handle; time_t created; std::string version; std::string author; @@ -285,7 +285,7 @@ CoreExport class Module /** Used to manage modules. */ -CoreExport class ModuleManager +class CoreExport ModuleManager { public: /** Load up a list of modules. diff --git a/include/services.h b/include/services.h index ad67f1eb4..163d620fa 100644 --- a/include/services.h +++ b/include/services.h @@ -178,10 +178,18 @@ extern int strncasecmp(const char *, const char *, size_t); #define MARK_DEPRECATED #endif -/** XXX: we need to grab these from inspircd -- w00t - */ -#define DllExport -#define CoreExport +#ifdef _WIN32 +# ifdef MODULE_COMPILE +# define CoreExport __declspec(dllimport) +# define DllExport __declspec(dllexport) +# else +# define CoreExport __declspec(dllexport) +# define DllExport __declspec(dllimport) +# endif +#else +# define DllExport +# define CoreExport +#endif /** This definition is used as shorthand for the various classes * and functions needed to make a module loadable by the OS. @@ -203,7 +211,7 @@ extern int strncasecmp(const char *, const char *, size_t); } \ return TRUE; \ } \ - extern "C" DllExport void *destroy_module(y *m) \ + extern "C" DllExport void destroy_module(y *m) \ { \ delete m; \ } diff --git a/include/sockets.h b/include/sockets.h index 470ad7761..dea2de663 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -22,6 +22,7 @@ typedef SOCKET ano_socket_t; #define ano_sockgeterr() WSAGetLastError() #define ano_sockseterr(err) WSASetLastError(err) /* ano_sockstrerror in sockutil.c */ +extern char *ano_sockstrerror(int); /* ano_socksetnonb in sockutil.c */ #define ano_sockerrnonb(err) (err == WSAEINPROGRESS || err == WSAEWOULDBLOCK) #define SOCKERR_EBADF WSAENOTSOCK diff --git a/include/users.h b/include/users.h index 315a6c508..a54ad255d 100644 --- a/include/users.h +++ b/include/users.h @@ -20,7 +20,7 @@ struct u_chaninfolist { }; /* Online user and channel data. */ -class User : public Extensible +class CoreExport User : public Extensible { public: // XXX: exposing a tiny bit too much User *next, *prev; -- cgit