diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/Makefile.win32 | 2 | ||||
-rw-r--r-- | src/core/ms_cancel.c | 10 | ||||
-rw-r--r-- | src/core/ms_check.c | 8 | ||||
-rw-r--r-- | src/core/ms_del.c | 19 | ||||
-rw-r--r-- | src/core/ms_info.c | 36 | ||||
-rw-r--r-- | src/core/ms_list.c | 20 | ||||
-rw-r--r-- | src/core/ms_read.c | 16 | ||||
-rw-r--r-- | src/init.c | 4 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/makefile.win32 | 29 | ||||
-rw-r--r-- | src/misc.c | 2 | ||||
-rw-r--r-- | src/modulemanager.cpp | 6 | ||||
-rw-r--r-- | src/modules/makefile.win32 | 6 | ||||
-rw-r--r-- | src/protocol/Makefile.win32 | 4 | ||||
-rw-r--r-- | src/tools/db-convert.c | 3 | ||||
-rw-r--r-- | src/tools/db-merger.c | 2 |
16 files changed, 90 insertions, 79 deletions
diff --git a/src/core/Makefile.win32 b/src/core/Makefile.win32 index f313fe862..b005fd1de 100644 --- a/src/core/Makefile.win32 +++ b/src/core/Makefile.win32 @@ -3,7 +3,7 @@ include ../../Makefile.inc.win32 SRCS=bs_act.c bs_assign.c bs_badwords.c bs_bot.c bs_botlist.c bs_fantasy.c bs_fantasy_kick.c bs_fantasy_kickban.c bs_fantasy_owner.c bs_fantasy_seen.c bs_help.c bs_info.c bs_kick.c bs_say.c bs_set.c bs_unassign.c cs_access.c cs_akick.c cs_ban.c cs_clear.c cs_drop.c cs_forbid.c cs_getkey.c cs_getpass.c cs_help.c cs_identify.c cs_info.c cs_invite.c cs_kick.c cs_list.c cs_logout.c cs_modes.c cs_register.c cs_sendpass.c cs_set.c cs_status.c cs_suspend.c cs_topic.c cs_xop.c enc_none.c enc_md5.c enc_old.c he_help.c hs_del.c hs_delall.c hs_group.c hs_help.c hs_list.c hs_off.c hs_on.c hs_set.c hs_setall.c ms_cancel.c ms_check.c ms_del.c ms_help.c ms_info.c ms_list.c ms_read.c ms_rsend.c ms_send.c ms_sendall.c ms_set.c ms_staff.c ns_access.c ns_alist.c ns_drop.c ns_forbid.c ns_getemail.c ns_getpass.c ns_ghost.c ns_group.c ns_help.c ns_identify.c ns_info.c ns_list.c ns_logout.c ns_recover.c ns_register.c ns_release.c ns_sendpass.c ns_set.c ns_saset.c ns_status.c ns_suspend.c ns_update.c os_admin.c os_akill.c os_chankill.c os_chanlist.c os_clearmodes.c os_defcon.c os_global.c os_help.c os_ignore.c os_jupe.c os_kick.c os_logonnews.c os_mode.c os_modinfo.c os_modlist.c os_modload.c os_modunload.c os_noop.c os_oline.c os_oper.c os_opernews.c os_quit.c os_randomnews.c os_raw.c os_reload.c os_restart.c os_session.c os_set.c os_sgline.c os_shutdown.c os_sqline.c os_staff.c os_stats.c os_svsnick.c os_szline.c os_umode.c os_update.c os_userlist.c OBJECTS= $(SRCS:.c=.dll) CFLAGS=/LD /MD /D MODULE_COMPILE $(CFLAGS) /I"../../include" -LFLAGS=/link ../anope.lib wsock32.lib $(LIBS) $(LFLAGS) $(MYSQL_LIB_PATH) /export:AnopeInit /export:AnopeFini /VERSION:$(VERSION) +LFLAGS=/link ../anope.lib wsock32.lib $(LIBS) $(LFLAGS) $(MYSQL_LIB_PATH) /export:init_module /export:destroy_module /VERSION:$(VERSION) all: $(OBJECTS) diff --git a/src/core/ms_cancel.c b/src/core/ms_cancel.c index c7a5402d0..715481777 100644 --- a/src/core/ms_cancel.c +++ b/src/core/ms_cancel.c @@ -76,11 +76,11 @@ int do_cancel(User * u) } else { int i; - for (i = mi->memocount - 1; i >= 0; i--) { - if ((mi->memos[i].flags & MF_UNREAD) - && !stricmp(mi->memos[i].sender, u->na->nc->display) - && (!(mi->memos[i].flags & MF_NOTIFYS))) { - delmemo(mi, mi->memos[i].number); + for (i = mi->memos.size() - 1; i >= 0; i--) { + if ((mi->memos[i]->flags & MF_UNREAD) + && !stricmp(mi->memos[i]->sender, u->na->nc->display) + && (!(mi->memos[i]->flags & MF_NOTIFYS))) { + delmemo(mi, mi->memos[i]->number); notice_lang(s_MemoServ, u, MEMO_CANCELLED, name); return MOD_CONT; } diff --git a/src/core/ms_check.c b/src/core/ms_check.c index 383291635..e656d5e3b 100644 --- a/src/core/ms_check.c +++ b/src/core/ms_check.c @@ -80,15 +80,15 @@ int do_memocheck(User * u) /* Okay, I know this looks strange but we wanna get the LAST memo, so we have to loop backwards */ - for (i = (mi->memocount - 1); i >= 0; i--) { - if (!stricmp(mi->memos[i].sender, u->na->nc->display)) { + for (i = (mi->memos.size() - 1); i >= 0; i--) { + if (!stricmp(mi->memos[i]->sender, u->na->nc->display)) { found = 1; /* Yes, we've found the memo */ - tm = localtime(&mi->memos[i].time); + tm = localtime(&mi->memos[i]->time); strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_DATE_TIME_FORMAT, tm); - if (mi->memos[i].flags & MF_UNREAD) + if (mi->memos[i]->flags & MF_UNREAD) notice_lang(s_MemoServ, u, MEMO_CHECK_NOT_READ, na->nick, timebuf); else diff --git a/src/core/ms_del.c b/src/core/ms_del.c index fb620a013..0d0e3fe07 100644 --- a/src/core/ms_del.c +++ b/src/core/ms_del.c @@ -88,7 +88,7 @@ int do_del(User * u) || (!isdigit(*numstr) && stricmp(numstr, "ALL") != 0 && stricmp(numstr, "LAST") != 0)) { syntax_error(s_MemoServ, u, "DEL", MEMO_DEL_SYNTAX); - } else if (mi->memocount == 0) { + } else if (mi->memos.size() == 0) { if (chan) notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan); else @@ -128,18 +128,17 @@ int do_del(User * u) } } else if (stricmp(numstr, "LAST") == 0) { /* Delete last memo. */ - for (i = 0; i < mi->memocount; i++) - last = mi->memos[i].number; + for (i = 0; i < mi->memos.size(); i++) + last = mi->memos[i]->number; delmemo(mi, last); notice_lang(s_MemoServ, u, MEMO_DELETED_ONE, last); } else { /* Delete all memos. */ - for (i = 0; i < mi->memocount; i++) { - delete [] mi->memos[i].text; + for (i = 0; i < mi->memos.size(); i++) { + delete [] mi->memos[i]->text; + delete mi->memos[i]; } - free(mi->memos); - mi->memos = NULL; - mi->memocount = 0; + mi->memos.clear(); if (chan) notice_lang(s_MemoServ, u, MEMO_CHAN_DELETED_ALL, chan); else @@ -147,8 +146,8 @@ int do_del(User * u) } /* Reset the order */ - for (i = 0; i < mi->memocount; i++) - mi->memos[i].number = i + 1; + for (i = 0; i < mi->memos.size(); i++) + mi->memos[i]->number = i + 1; } return MOD_CONT; } diff --git a/src/core/ms_info.c b/src/core/ms_info.c index 501730416..a519b0beb 100644 --- a/src/core/ms_info.c +++ b/src/core/ms_info.c @@ -98,31 +98,31 @@ int do_info(User * u) if (name && (ci || na->nc != u->na->nc)) { - if (!mi->memocount) { + if (mi->memos.empty()) { notice_lang(s_MemoServ, u, MEMO_INFO_X_NO_MEMOS, name); - } else if (mi->memocount == 1) { - if (mi->memos[0].flags & MF_UNREAD) + } else if (mi->memos.size() == 1) { + if (mi->memos[0]->flags & MF_UNREAD) notice_lang(s_MemoServ, u, MEMO_INFO_X_MEMO_UNREAD, name); else notice_lang(s_MemoServ, u, MEMO_INFO_X_MEMO, name); } else { int count = 0, i; - for (i = 0; i < mi->memocount; i++) { - if (mi->memos[i].flags & MF_UNREAD) + for (i = 0; i < mi->memos.size(); i++) { + if (mi->memos[i]->flags & MF_UNREAD) count++; } - if (count == mi->memocount) + if (count == mi->memos.size()) notice_lang(s_MemoServ, u, MEMO_INFO_X_MEMOS_ALL_UNREAD, name, count); else if (count == 0) notice_lang(s_MemoServ, u, MEMO_INFO_X_MEMOS, name, - mi->memocount); + mi->memos.size()); else if (count == 1) notice_lang(s_MemoServ, u, MEMO_INFO_X_MEMOS_ONE_UNREAD, - name, mi->memocount); + name, mi->memos.size()); else notice_lang(s_MemoServ, u, MEMO_INFO_X_MEMOS_SOME_UNREAD, - name, mi->memocount, count); + name, mi->memos.size(), count); } if (mi->memomax == 0) { if (hardmax) @@ -161,30 +161,30 @@ int do_info(User * u) } else { /* !name || (!ci || na->nc == u->na->nc) */ - if (!mi->memocount) { + if (mi->memos.empty()) { notice_lang(s_MemoServ, u, MEMO_INFO_NO_MEMOS); - } else if (mi->memocount == 1) { - if (mi->memos[0].flags & MF_UNREAD) + } else if (mi->memos.size() == 1) { + if (mi->memos[0]->flags & MF_UNREAD) notice_lang(s_MemoServ, u, MEMO_INFO_MEMO_UNREAD); else notice_lang(s_MemoServ, u, MEMO_INFO_MEMO); } else { int count = 0, i; - for (i = 0; i < mi->memocount; i++) { - if (mi->memos[i].flags & MF_UNREAD) + for (i = 0; i < mi->memos.size(); i++) { + if (mi->memos[i]->flags & MF_UNREAD) count++; } - if (count == mi->memocount) + if (count == mi->memos.size()) notice_lang(s_MemoServ, u, MEMO_INFO_MEMOS_ALL_UNREAD, count); else if (count == 0) - notice_lang(s_MemoServ, u, MEMO_INFO_MEMOS, mi->memocount); + notice_lang(s_MemoServ, u, MEMO_INFO_MEMOS, mi->memos.size()); else if (count == 1) notice_lang(s_MemoServ, u, MEMO_INFO_MEMOS_ONE_UNREAD, - mi->memocount); + mi->memos.size()); else notice_lang(s_MemoServ, u, MEMO_INFO_MEMOS_SOME_UNREAD, - mi->memocount, count); + mi->memos.size(), count); } if (mi->memomax == 0) { diff --git a/src/core/ms_list.c b/src/core/ms_list.c index 148433ff0..c8937134d 100644 --- a/src/core/ms_list.c +++ b/src/core/ms_list.c @@ -83,7 +83,7 @@ int do_list(User * u) } if (param && !isdigit(*param) && stricmp(param, "NEW") != 0) { syntax_error(s_MemoServ, u, "LIST", MEMO_LIST_SYNTAX); - } else if (mi->memocount == 0) { + } else if (mi->memos.size() == 0) { if (chan) notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan); else @@ -95,11 +95,11 @@ int do_list(User * u) mi, &sent_header, chan); } else { if (param) { - for (i = 0, m = mi->memos; i < mi->memocount; i++, m++) { - if (m->flags & MF_UNREAD) + for (i = 0; i < mi->memos.size(); i++) { + if (mi->memos[i]->flags & MF_UNREAD) break; } - if (i == mi->memocount) { + if (i == mi->memos.size()) { if (chan) notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_NEW_MEMOS, chan); @@ -108,8 +108,8 @@ int do_list(User * u) return MOD_CONT; } } - for (i = 0, m = mi->memos; i < mi->memocount; i++, m++) { - if (param && !(m->flags & MF_UNREAD)) + for (i = 0; i < mi->memos.size(); i++) { + if (param && !(mi->memos[i]->flags & MF_UNREAD)) continue; list_memo(u, i, mi, &sent_header, param != NULL, chan); } @@ -132,8 +132,8 @@ int list_memo_callback(User * u, int num, va_list args) const char *chan = va_arg(args, const char *); int i; - for (i = 0; i < mi->memocount; i++) { - if (mi->memos[i].number == num) + for (i = 0; i < mi->memos.size(); i++) { + if (mi->memos[i]->number == num) break; } /* Range checking done by list_memo() */ @@ -156,7 +156,7 @@ int list_memo(User * u, int index, MemoInfo * mi, int *sent_header, int newi, co char timebuf[64]; struct tm tm; - if (index < 0 || index >= mi->memocount) + if (index < 0 || index >= mi->memos.size()) return 0; if (!*sent_header) { if (chan) { @@ -171,7 +171,7 @@ int list_memo(User * u, int index, MemoInfo * mi, int *sent_header, int newi, co notice_lang(s_MemoServ, u, MEMO_LIST_HEADER); *sent_header = 1; } - m = &mi->memos[index]; + m = mi->memos[index]; tm = *localtime(&m->time); strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_DATE_TIME_FORMAT, &tm); diff --git a/src/core/ms_read.c b/src/core/ms_read.c index 07f293156..2760beec7 100644 --- a/src/core/ms_read.c +++ b/src/core/ms_read.c @@ -88,7 +88,7 @@ int do_read(User * u) && num <= 0)) { syntax_error(s_MemoServ, u, "READ", MEMO_READ_SYNTAX); - } else if (mi->memocount == 0) { + } else if (mi->memos.empty()) { if (chan) notice_lang(s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan); else @@ -99,8 +99,8 @@ int do_read(User * u) if (stricmp(numstr, "NEW") == 0) { int readcount = 0; - for (i = 0; i < mi->memocount; i++) { - if (mi->memos[i].flags & MF_UNREAD) { + for (i = 0; i < mi->memos.size(); i++) { + if (mi->memos[i]->flags & MF_UNREAD) { read_memo(u, i, mi, chan); readcount++; } @@ -113,7 +113,7 @@ int do_read(User * u) notice_lang(s_MemoServ, u, MEMO_HAVE_NO_NEW_MEMOS); } } else if (stricmp(numstr, "LAST") == 0) { - for (i = 0; i < mi->memocount - 1; i++); + for (i = 0; i < mi->memos.size() - 1; i++); read_memo(u, i, mi, chan); } else { /* number[s] */ if (!process_numlist(numstr, &count, read_memo_callback, u, @@ -143,8 +143,8 @@ int read_memo_callback(User * u, int num, va_list args) const char *chan = va_arg(args, const char *); int i; - for (i = 0; i < mi->memocount; i++) { - if (mi->memos[i].number == num) + for (i = 0; i < mi->memos.size(); i++) { + if (mi->memos[i]->number == num) break; } /* Range check done in read_memo */ @@ -165,9 +165,9 @@ int read_memo(User * u, int index, MemoInfo * mi, const char *chan) char timebuf[64]; struct tm tm; - if (index < 0 || index >= mi->memocount) + if (index < 0 || index >= mi->memos.size()) return 0; - m = &mi->memos[index]; + m = mi->memos[index]; tm = *localtime(&m->time); strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_DATE_TIME_FORMAT, &tm); diff --git a/src/init.c b/src/init.c index ac1837fb9..1168a4515 100644 --- a/src/init.c +++ b/src/init.c @@ -317,7 +317,11 @@ static void write_pidfile(void) pidfile = fopen(PIDFilename, "w"); if (pidfile) { +#ifdef _WIN32 + fprintf(pidfile, "%d\n", static_cast<int>(GetCurrentProcessId())); +#else fprintf(pidfile, "%d\n", static_cast<int>(getpid())); +#endif fclose(pidfile); atexit(remove_pidfile); } else { diff --git a/src/main.c b/src/main.c index 53bebd298..69b887140 100644 --- a/src/main.c +++ b/src/main.c @@ -48,6 +48,8 @@ int protocoldebug = 0; /* -protocoldebug */ #ifdef _WIN32 char *binary_dir; /* Used to store base path for win32 restart */ +#include <process.h> +#define execve _execve #endif /* Set to 1 if we are to quit */ diff --git a/src/makefile.win32 b/src/makefile.win32 index 718948d88..8490ee507 100644 --- a/src/makefile.win32 +++ b/src/makefile.win32 @@ -6,9 +6,9 @@ # Please read COPYING and README for further details. # # Based on the original code of Epona by Lara. -# Based on the original code of Services by Andy Church. -# -# $Id:$ +# Based on the original code of Services by Andy Church. +# +# $Id:$ # # Source Makefile @@ -19,19 +19,19 @@ include ../Makefile.inc.win32 OBJS = actions.obj base64.obj bots.obj botserv.obj channels.obj chanserv.obj commands.obj compat.obj \ config.obj datafiles.obj encrypt.obj events.obj helpserv.obj hostserv.obj \ - init.obj ircd.obj language.obj list.obj log.obj mail.obj main.obj memory.obj \ + init.obj ircd.obj language.obj log.obj mail.obj main.obj memory.obj \ memoserv.obj messages.obj misc.obj modules.obj mod_version.obj news.obj nickserv.obj operserv.obj \ process.obj send.obj servers.obj sessions.obj slist.obj sockutil.obj \ - timeout.obj users.obj module.obj modulemanager.obj - + timeout.obj users.obj module.obj modulemanager.obj hashcomp.obj + SRCS = actions.c base64.c botserv.c bots.cpp channels.c chanserv.c commands.c compat.c \ config.c datafiles.c encrypt.c events.c helpserv.c hostserv.c init.c ircd.c \ - language.c list.c log.c mail.c main.c memory.c memoserv.c messages.c misc.c \ + language.c log.c mail.c main.c memory.c memoserv.c messages.c misc.c \ modules.c mod_version.c news.c nickserv.c operserv.c process.c send.c servers.obj sessions.c \ - slist.c sockutil.c timeout.c users.c module.cpp modulemanager.cpp + slist.c sockutil.c timeout.c users.c module.cpp modulemanager.cpp hashcomp.cpp ########################################################################### - + .c.obj: $(CC) $(CFLAGS) -c $< @@ -46,9 +46,9 @@ $(PROGRAM): $(OBJS) win32.res spotless: -@erase *.obj *.exe *.exp *.lib tools\*.exe *.res win32.rc *.manifest - + install: - -@copy anope.exe ..\anope.exe + -@copy anope.exe ..\anope.exe -@mkdir ..\$(DATDEST)\bin -@copy bin\* ..\$(DATDEST)\bin -@copy anope.exe.manifest ..\anope.exe.manifest @@ -56,9 +56,9 @@ install: win32.res: win32.rc $(RC) /l 0x409 $(RC_FLAGS) /fowin32.res win32.rc - + ########################################################################### - + # Catch any changes in compilation options at the top of this file $(OBJS): @@ -76,6 +76,7 @@ encrypt.obj: encrypt.c ..\include\encrypt.h ..\include\sysconf.h events.obj: events.c ..\include\modules.h ..\include\language.h ..\include\version.h init.obj: init.c ..\include\services.h ircd.obj: ircd.c ..\include\services.h +hashcomp.obj: hashcomp.cpp ..\include\services.h ..\include\hashcomp.h hostserv.obj: hostserv.c ..\include\services.h ..\include\pseudo.h language.obj: language.c ..\include\services.h ..\include\language.h list.obj: list.c ..\include\services.h @@ -110,7 +111,7 @@ vsnprintf.obj: vsnprintf.c ..\include\extern.h: ..\include\slist.h ..\include\pseudo.h: ..\include\commands.h ..\include\language.h ..\include\timeout.h ..\include\encrypt.h ..\include\datafiles.h ..\include\slist.h - + ########################################################################### FRC: diff --git a/src/misc.c b/src/misc.c index ccdfeaf15..ab164800a 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1336,8 +1336,10 @@ char *GetWindowsVersion(void) extra = sstrdup("Datacenter Edition"); } else if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) { extra = sstrdup("Enterprise Edition"); +#ifdef VER_SUITE_COMPUTE_SERVER } else if (osvi.wSuiteMask & VER_SUITE_COMPUTE_SERVER) { extra = sstrdup("Compute Cluster Edition"); +#endif } else if (osvi.wSuiteMask == VER_SUITE_BLADE) { extra = sstrdup("Web Edition"); } else { diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp index f584fe3ff..7ffe35a7a 100644 --- a/src/modulemanager.cpp +++ b/src/modulemanager.cpp @@ -54,7 +54,7 @@ static int moduleCopyFile(const char *name, const char *output) if ((srcfp = mkstemp(const_cast<char *>(output))) == -1) return MOD_ERR_FILE_IO; #else - if (!mktemp(output)) + if (!mktemp(const_cast<char *>(output))) return MOD_ERR_FILE_IO; #endif @@ -152,7 +152,7 @@ int ModuleManager::LoadModule(const std::string &modname, User * u) ano_modclearerr(); - void *handle = ano_modopen(pbuf.c_str()); + ano_module_t handle = ano_modopen(pbuf.c_str()); if (handle == NULL && (err = ano_moderr()) != NULL) { alog("%s", err); @@ -253,7 +253,7 @@ void ModuleManager::DeleteModule(Module *m) { const char *err; void (*destroy_func)(Module *m); - void *handle; + ano_module_t handle; if (!m || !m->handle) /* check m is least possibly valid */ { diff --git a/src/modules/makefile.win32 b/src/modules/makefile.win32 index 038ff25ba..fffa51d74 100644 --- a/src/modules/makefile.win32 +++ b/src/modules/makefile.win32 @@ -3,7 +3,7 @@ include ./Makefile.inc.win32 OBJECTS= $(SRCS:.c=.dll) CFLAGS=/LD /MD /D MODULE_COMPILE $(CFLAGS) /I"../../include" -LFLAGS=/link ../anope.lib wsock32.lib $(LIBS) $(LFLAGS) $(MYSQL_LIB_PATH) /export:AnopeInit /export:AnopeFini +LFLAGS=/link ../anope.lib wsock32.lib $(LIBS) $(LFLAGS) $(MYSQL_LIB_PATH) /export:init_module /export:destroy_module all: $(OBJECTS) subs @@ -11,7 +11,7 @@ distclean: clean spotless .c.dll: $(CC) $(CFLAGS) $(IRCTYPE) $< ..\mod_version.c $(LFLAGS) - + subs: @for %i in ( $(SUBS) ); do \ @if exist %i; @cd %i && $(MAKE) $(MAKEARGS) && cd .. @@ -29,7 +29,7 @@ spotless: clean subs-spotless subs-spotless: @for %i in ( $(SUBS) ); do \ @if exist %i; @cd %i && $(MAKE) $(MAKEARGS) spotless && cd .. - + install: -@mkdir ..\..\$(DATDEST)\modules -@mkdir ..\..\$(DATDEST)\modules\runtime diff --git a/src/protocol/Makefile.win32 b/src/protocol/Makefile.win32 index da1f018c4..aec850976 100644 --- a/src/protocol/Makefile.win32 +++ b/src/protocol/Makefile.win32 @@ -2,10 +2,10 @@ include ../../Makefile.inc.win32 SRCS=bahamut.c inspircd11.c inspircd12.cpp \ ratbox.c unreal32.c +OBJECTS=bahamut.dll inspircd11.dll inspircd12.dll ratbox.dll unreal32.dll -OBJECTS= $(SRCS:.c=.dll) CFLAGS=/LD /MD /D MODULE_COMPILE $(CFLAGS) /I"../../include" -LFLAGS=/link ../anope.lib wsock32.lib $(LIBS) $(LFLAGS) $(MYSQL_LIB_PATH) /export:AnopeInit /VERSION:$(VERSION) +LFLAGS=/link ../anope.lib wsock32.lib $(LIBS) $(LFLAGS) $(MYSQL_LIB_PATH) /export:init_module /export:destroy_module /VERSION:$(VERSION) all: $(OBJECTS) diff --git a/src/tools/db-convert.c b/src/tools/db-convert.c index d61e9c417..7093f2960 100644 --- a/src/tools/db-convert.c +++ b/src/tools/db-convert.c @@ -27,6 +27,7 @@ #else #include "sysconf.h" #include <windows.h> +#include <io.h> #endif #include <string> @@ -1079,7 +1080,7 @@ dbFILE *open_db_write(const char *service, const char *filename, int version) #ifndef _WIN32 fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0666); #else - fd = open(filename, O_WRONLY | O_CREAT | O_EXCL | _O_BINARY, 0666); + fd = _open(filename, O_WRONLY | O_CREAT | O_EXCL | _O_BINARY, 0666); #endif f->fp = fdopen(fd, "wb"); /* will fail and return NULL if fd < 0 */ if (!f->fp || !write_file_version(f, version)) { diff --git a/src/tools/db-merger.c b/src/tools/db-merger.c index c141e8382..81d03bba8 100644 --- a/src/tools/db-merger.c +++ b/src/tools/db-merger.c @@ -57,6 +57,8 @@ #else #include "sysconf.h" #include <windows.h> +#include <io.h> +#define open _open #endif /* Some SUN fixs */ |