diff options
| author | Adam <Adam@anope.org> | 2012-09-02 08:30:54 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2012-09-02 08:30:54 -0400 |
| commit | 1af64a9bbb150b9daae3944d6aae86864c271103 (patch) | |
| tree | c24a1ac6793e997f83ac66810b611f88855fcd90 /include | |
| parent | e3d5140dcc936ff411c438b7e3997104cb5f085a (diff) | |
Fix Windows
Diffstat (limited to 'include')
| -rw-r--r-- | include/account.h | 14 | ||||
| -rw-r--r-- | include/anope.h | 14 | ||||
| -rw-r--r-- | include/bots.h | 10 | ||||
| -rw-r--r-- | include/channels.h | 14 | ||||
| -rw-r--r-- | include/commands.h | 2 | ||||
| -rw-r--r-- | include/config.h | 2 | ||||
| -rw-r--r-- | include/defs.h | 4 | ||||
| -rw-r--r-- | include/extensible.h | 2 | ||||
| -rw-r--r-- | include/extern.h | 13 | ||||
| -rw-r--r-- | include/modules.h | 2 | ||||
| -rw-r--r-- | include/protocol.h | 12 | ||||
| -rw-r--r-- | include/regchannel.h | 11 | ||||
| -rw-r--r-- | include/serialize.h | 2 | ||||
| -rw-r--r-- | include/services.h | 21 | ||||
| -rw-r--r-- | include/sockets.h | 8 | ||||
| -rw-r--r-- | include/uplink.h | 2 | ||||
| -rw-r--r-- | include/users.h | 19 |
17 files changed, 80 insertions, 72 deletions
diff --git a/include/account.h b/include/account.h index 756c97348..ff9c70727 100644 --- a/include/account.h +++ b/include/account.h @@ -23,8 +23,8 @@ typedef Anope::insensitive_map<NickAlias *> nickalias_map; typedef Anope::insensitive_map<NickCore *> nickcore_map; -extern serialize_checker<nickalias_map> NickAliasList; -extern serialize_checker<nickcore_map> NickCoreList; +extern CoreExport serialize_checker<nickalias_map> NickAliasList; +extern CoreExport serialize_checker<nickcore_map> NickCoreList; /* NickServ nickname structures. */ @@ -309,11 +309,11 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END }; -extern void change_core_display(NickCore *nc); -extern void change_core_display(NickCore *nc, const Anope::string &newdisplay); +extern CoreExport void change_core_display(NickCore *nc); +extern CoreExport void change_core_display(NickCore *nc, const Anope::string &newdisplay); -extern NickAlias *findnick(const Anope::string &nick); -extern NickCore *findcore(const Anope::string &nick); -extern bool is_on_access(const User *u, const NickCore *nc); +extern CoreExport NickAlias *findnick(const Anope::string &nick); +extern CoreExport NickCore *findcore(const Anope::string &nick); +extern CoreExport bool is_on_access(const User *u, const NickCore *nc); #endif // ACCOUNT_H diff --git a/include/anope.h b/include/anope.h index 2ec6602ea..e67fafc8d 100644 --- a/include/anope.h +++ b/include/anope.h @@ -23,7 +23,7 @@ namespace Anope * allow us to only require one type of string everywhere that can be converted * at any time to a specific type of string. */ - class string + class CoreExport string { private: /** @@ -589,6 +589,18 @@ template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr) #endif } +template<typename T, typename O> inline T anope_dynamic_reinterpret_cast(O ptr) +{ +#ifdef DEBUG_BUILD + T ret = dynamic_cast<T>(ptr); + if (ptr != NULL && ret == NULL) + throw CoreException(Anope::string("anope_dynamic_reinterpret_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail"); + return ret; +#else + return reinterpret_cast<T>(ptr); +#endif +} + /*************************************************************************/ /** Class with the ability to keep flags on items, they should extend from this diff --git a/include/bots.h b/include/bots.h index 749e4c92d..521ab8c03 100644 --- a/include/bots.h +++ b/include/bots.h @@ -17,8 +17,8 @@ typedef Anope::insensitive_map<BotInfo *> botinfo_map; typedef Anope::map<BotInfo *> botinfouid_map; -extern serialize_checker<botinfo_map> BotListByNick; -extern serialize_checker<botinfouid_map> BotListByUID; +extern CoreExport serialize_checker<botinfo_map> BotListByNick; +extern CoreExport serialize_checker<botinfouid_map> BotListByUID; /** Flags settable on a bot */ @@ -132,9 +132,9 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>, public Se CommandInfo *GetCommand(const Anope::string &cname); }; -extern BotInfo *findbot(const Anope::string &nick); +extern CoreExport BotInfo *findbot(const Anope::string &nick); -extern void bot_raw_ban(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason); -extern void bot_raw_kick(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason); +extern CoreExport void bot_raw_ban(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason); +extern CoreExport void bot_raw_kick(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason); #endif // BOTS_H diff --git a/include/channels.h b/include/channels.h index bcde363fc..dbc71129d 100644 --- a/include/channels.h +++ b/include/channels.h @@ -246,15 +246,15 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags< void Hold(); }; -extern Channel *findchan(const Anope::string &chan); +extern CoreExport Channel *findchan(const Anope::string &chan); -extern User *nc_on_chan(Channel *c, const NickCore *nc); +extern CoreExport User *nc_on_chan(Channel *c, const NickCore *nc); -extern void do_cmode(const Anope::string &source, const Anope::string &channel, const Anope::string &modes, const Anope::string &ts); -extern void do_join(const Anope::string &source, const Anope::string &channels, const Anope::string &ts); -extern void do_kick(const Anope::string &source, const Anope::string &channel, const Anope::string &users, const Anope::string &reason); -extern void do_part(const Anope::string &source, const Anope::string &channels, const Anope::string &reason); +extern CoreExport void do_cmode(const Anope::string &source, const Anope::string &channel, const Anope::string &modes, const Anope::string &ts); +extern CoreExport void do_join(const Anope::string &source, const Anope::string &channels, const Anope::string &ts); +extern CoreExport void do_kick(const Anope::string &source, const Anope::string &channel, const Anope::string &users, const Anope::string &reason); +extern CoreExport void do_part(const Anope::string &source, const Anope::string &channels, const Anope::string &reason); -extern void chan_set_correct_modes(const User *user, Channel *c, int give_modes); +extern CoreExport void chan_set_correct_modes(const User *user, Channel *c, int give_modes); #endif // CHANNELS_H diff --git a/include/commands.h b/include/commands.h index d644ea8cb..c3a412624 100644 --- a/include/commands.h +++ b/include/commands.h @@ -142,6 +142,6 @@ class CoreExport Command : public Service, public Flags<CommandFlag> virtual void OnSyntaxError(CommandSource &source, const Anope::string &subcommand); }; -extern void RunCommand(CommandSource &source, const Anope::string &message); +extern CoreExport void RunCommand(CommandSource &source, const Anope::string &message); #endif // COMMANDS_H diff --git a/include/config.h b/include/config.h index 0ab3c287b..e37028bcf 100644 --- a/include/config.h +++ b/include/config.h @@ -805,6 +805,6 @@ class CoreExport ConfigReader }; extern ConfigurationFile services_conf; -extern ServerConfig *Config; +extern CoreExport ServerConfig *Config; #endif // CONFIG_H diff --git a/include/defs.h b/include/defs.h index db3c801ed..2df0a2c15 100644 --- a/include/defs.h +++ b/include/defs.h @@ -21,6 +21,7 @@ class ChannelInfo; class ChannelStatus; class ClientSocket; class Command; +class CommandSource; class ConnectionSocket; class DNSPacket; class dynamic_reference_base; @@ -42,13 +43,12 @@ class ServerConfig; class Socket; class Thread; class User; +class XLine; class XLineManager; struct BadWord; -struct CommandSource; struct DNSQuery; struct Exception; struct MemoInfo; struct ModeLock; struct Oper; -struct XLine; diff --git a/include/extensible.h b/include/extensible.h index 5d0cdafa5..162a2cf6f 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -95,7 +95,7 @@ class CoreExport Extensible { extensible_map::const_iterator it = this->extension_items.find(key); if (it != this->extension_items.end()) - return anope_dynamic_static_cast<T>(it->second); + return anope_dynamic_reinterpret_cast<T>(it->second); return NULL; } diff --git a/include/extern.h b/include/extern.h index 29f84c850..5eb7dcb58 100644 --- a/include/extern.h +++ b/include/extern.h @@ -23,19 +23,6 @@ E bool bad_password(User *u); E void common_unban(const ChannelInfo *ci, User *u, bool full = false); -/**** channels.c ****/ - -E Channel *findchan(const Anope::string &chan); - -E User *nc_on_chan(Channel *c, const NickCore *nc); - -E void do_cmode(const Anope::string &source, const Anope::string &channel, const Anope::string &modes, const Anope::string &ts); -E void do_join(const Anope::string &source, const Anope::string &channels, const Anope::string &ts); -E void do_kick(const Anope::string &source, const Anope::string &channel, const Anope::string &users, const Anope::string &reason); -E void do_part(const Anope::string &source, const Anope::string &channels, const Anope::string &reason); - -E void chan_set_correct_modes(const User *user, Channel *c, int give_modes); - /**** encrypt.c ****/ E void enc_encrypt(const Anope::string &src, Anope::string &dest); diff --git a/include/modules.h b/include/modules.h index ae7ab139a..939b98b34 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1111,7 +1111,7 @@ class CoreExport ModuleManager /** Class used for callbacks within modules */ -class CallBack : public Timer +class CoreExport CallBack : public Timer { private: Module *m; diff --git a/include/protocol.h b/include/protocol.h index b471ce23f..5fb9da403 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -144,12 +144,12 @@ class CoreExport IRCdMessage virtual bool OnError(const Anope::string &, const std::vector<Anope::string> &); }; -extern IRCDVar *ircd; -extern IRCDProto *ircdproto; -extern IRCdMessage *ircdmessage; +extern CoreExport IRCDVar *ircd; +extern CoreExport IRCDProto *ircdproto; +extern CoreExport IRCdMessage *ircdmessage; -extern void pmodule_ircd_proto(IRCDProto *); -extern void pmodule_ircd_var(IRCDVar *ircdvar); -extern void pmodule_ircd_message(IRCdMessage *message); +extern CoreExport void pmodule_ircd_proto(IRCDProto *); +extern CoreExport void pmodule_ircd_var(IRCDVar *ircdvar); +extern CoreExport void pmodule_ircd_message(IRCdMessage *message); #endif // PROTOCOL_H diff --git a/include/regchannel.h b/include/regchannel.h index 255bcc200..9640a6735 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -16,10 +16,11 @@ #include "logger.h" #include "modules.h" #include "serialize.h" +#include "bots.h" typedef Anope::insensitive_map<ChannelInfo *> registered_channel_map; -extern serialize_checker<registered_channel_map> RegisteredChannelList; +extern CoreExport serialize_checker<registered_channel_map> RegisteredChannelList; /** Flags used for the ChannelInfo class */ @@ -441,9 +442,9 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, void ClearLevels(); }; -extern ChannelInfo *cs_findchan(const Anope::string &chan); -extern bool IsFounder(const User *user, const ChannelInfo *ci); -extern void update_cs_lastseen(User *user, ChannelInfo *ci); -extern int get_idealban(const ChannelInfo *ci, User *u, Anope::string &ret); +extern CoreExport ChannelInfo *cs_findchan(const Anope::string &chan); +extern CoreExport bool IsFounder(const User *user, const ChannelInfo *ci); +extern CoreExport void update_cs_lastseen(User *user, ChannelInfo *ci); +extern CoreExport int get_idealban(const ChannelInfo *ci, User *u, Anope::string &ret); #endif // REGCHANNEL_H diff --git a/include/serialize.h b/include/serialize.h index 1b932c17d..5f8801854 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -27,7 +27,7 @@ namespace Serialize }; } -class stringstream : public std::stringstream +class CoreExport stringstream : public std::stringstream { private: Serialize::DataType type; diff --git a/include/services.h b/include/services.h index 31ab1cf37..4b21bac2a 100644 --- a/include/services.h +++ b/include/services.h @@ -28,6 +28,10 @@ # include <strings.h> #endif +#ifndef _WIN32 +#include <unistd.h> +#endif + /* Pull in the various bits of STL */ #include <iostream> #include <fstream> @@ -45,14 +49,6 @@ #define _(x) x -#ifndef _WIN32 -# define DllExport -# define CoreExport -# define MARK_DEPRECATED __attribute((deprecated)) -#else -# include "anope_windows.h" -#endif - #ifdef __GXX_EXPERIMENTAL_CXX0X__ # define anope_override override # define anope_final final @@ -61,6 +57,15 @@ # define anope_final #endif +#ifndef _WIN32 +# define DllExport +# define CoreExport +# define MARK_DEPRECATED __attribute((deprecated)) +# define anope_close close +#else +# include "anope_windows.h" +#endif + /** * RFC: defination of a valid nick * nickname = ( letter / special ) *8( letter / digit / special / "-" ) diff --git a/include/sockets.h b/include/sockets.h index 8f863b59c..8b669bbde 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -12,9 +12,11 @@ #ifndef SOCKETS_H #define SOCKETS_H +#ifndef _WIN32 #include <netinet/in.h> #include <sys/types.h> #include <sys/socket.h> +#endif #include "anope.h" @@ -482,8 +484,8 @@ class CoreExport Pipe : public Socket virtual void OnNotify() = 0; }; -extern uint32_t TotalRead; -extern uint32_t TotalWritten; -extern SocketIO normalSocketIO; +extern CoreExport uint32_t TotalRead; +extern CoreExport uint32_t TotalWritten; +extern CoreExport SocketIO normalSocketIO; #endif // SOCKET_H diff --git a/include/uplink.h b/include/uplink.h index 70b20a28b..617a8aa1a 100644 --- a/include/uplink.h +++ b/include/uplink.h @@ -42,7 +42,7 @@ class UplinkSocket : public ConnectionSocket, public BufferedSocket } }; }; -extern UplinkSocket *UplinkSock; +extern CoreExport UplinkSocket *UplinkSock; #endif // UPLINK_H diff --git a/include/users.h b/include/users.h index d0b38025e..fab5fa868 100644 --- a/include/users.h +++ b/include/users.h @@ -13,6 +13,7 @@ #include "extensible.h" #include "serialize.h" #include "commands.h" +#include "account.h" extern CoreExport Anope::insensitive_map<User *> UserListByNick; extern CoreExport Anope::map<User *> UserListByUID; @@ -303,19 +304,19 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe void Kill(const Anope::string &source, const Anope::string &reason); }; -extern int32_t opcnt; -extern uint32_t maxusercnt, usercnt; -extern time_t maxusertime; +extern CoreExport int32_t opcnt; +extern CoreExport uint32_t maxusercnt, usercnt; +extern CoreExport time_t maxusertime; -extern User *finduser(const Anope::string &nick); +extern CoreExport User *finduser(const Anope::string &nick); -extern User *do_nick(const Anope::string &source, const Anope::string &nick, const Anope::string &username, const Anope::string &host, const Anope::string &server, const Anope::string &realname, time_t ts, const Anope::string &ip, const Anope::string &vhost, const Anope::string &uid, const Anope::string &modes); +extern CoreExport User *do_nick(const Anope::string &source, const Anope::string &nick, const Anope::string &username, const Anope::string &host, const Anope::string &server, const Anope::string &realname, time_t ts, const Anope::string &ip, const Anope::string &vhost, const Anope::string &uid, const Anope::string &modes); -extern void do_umode(const Anope::string &user, const Anope::string &modes); -extern void do_kill(User *user, const Anope::string &reason); +extern CoreExport void do_umode(const Anope::string &user, const Anope::string &modes); +extern CoreExport void do_kill(User *user, const Anope::string &reason); -extern bool matches_list(Channel *c, User *user, ChannelModeName mode); +extern CoreExport bool matches_list(Channel *c, User *user, ChannelModeName mode); -extern Anope::string create_mask(User *u); +extern CoreExport Anope::string create_mask(User *u); #endif // USERS_H |
