diff options
author | Adam <Adam@anope.org> | 2010-10-30 19:41:13 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-10-30 19:41:13 -0400 |
commit | fb9f41b3e52cfddada7773a65b9723cd3a96b785 (patch) | |
tree | bd97f21b4a5098d43f2a680ae09136f3e0ef6bb5 /modules | |
parent | a7e5d51616363214d391500b2d9d647379fba833 (diff) |
Made gettext work on most OSs. Tested on Debian, FreeBSD, Gentoo, and Windows.
Added a search path option to the Config script for cmake to use when finding libraries for modules or for gettext.
Fixed m_mysql and m_ssl to work under Windows, made the Windows Config
program remember the last used options, and fixed Windows release builds.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/CMakeLists.txt | 2 | ||||
-rw-r--r-- | modules/extra/db_mysql.cpp | 2 | ||||
-rw-r--r-- | modules/extra/m_mysql.cpp | 24 |
3 files changed, 14 insertions, 14 deletions
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 21ca74244..46888a416 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -68,7 +68,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS}) endif(MSVC) # Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand add_library(${SO} MODULE ${SRC}) - set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS}") + set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS} /nodefaultlib:\"libcmt.lib\"") add_dependencies(${SO} ${PROGRAM_NAME}) # For Windows only, have the module link to the export library of Anope as well as the wsock32 library (most of the modules probably don't need this, but this is to be on the safe side), also set it's version if(WIN32) diff --git a/modules/extra/db_mysql.cpp b/modules/extra/db_mysql.cpp index af5c4514a..f430502a4 100644 --- a/modules/extra/db_mysql.cpp +++ b/modules/extra/db_mysql.cpp @@ -1429,7 +1429,7 @@ static void SaveDatabases() for (std::vector<Anope::string>::iterator it = nc->access.begin(), it_end = nc->access.end(); it != it_end; ++it) { - me->RunQuery("INSERT INTO `anope_ns_access` (display, access) VALUES(" + me->Escape(nc->display) + ", " + me->Escape(*it) + ")"); + me->RunQuery("INSERT INTO `anope_ns_access` (display, access) VALUES('" + me->Escape(nc->display) + "', '" + me->Escape(*it) + "')"); } for (unsigned j = 0, end = nc->memos.memos.size(); j < end; ++j) diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp index de855cead..eba2c0382 100644 --- a/modules/extra/m_mysql.cpp +++ b/modules/extra/m_mysql.cpp @@ -24,21 +24,21 @@ struct QueryRequest /* The connection to the database */ MySQLService *service; /* The interface to use once we have the result to send the data back */ - SQLInterface *interface; + SQLInterface *sqlinterface; /* The actual query */ Anope::string query; - QueryRequest(MySQLService *s, SQLInterface *i, const Anope::string &q) : service(s), interface(i), query(q) { } + QueryRequest(MySQLService *s, SQLInterface *i, const Anope::string &q) : service(s), sqlinterface(i), query(q) { } }; struct QueryResult { /* The interface to send the data back on */ - SQLInterface *interface; + SQLInterface *sqlinterface; /* The result */ SQLResult result; - QueryResult(SQLInterface *i, SQLResult &r) : interface(i), result(r) { } + QueryResult(SQLInterface *i, SQLResult &r) : sqlinterface(i), result(r) { } }; /** A MySQL result @@ -255,7 +255,7 @@ class ModuleSQL : public Module { QueryRequest &r = this->QueryRequests[i - 1]; - if (r.interface && r.interface->owner == m) + if (r.sqlinterface && r.sqlinterface->owner == m) { if (i == 1) { @@ -290,8 +290,8 @@ MySQLService::~MySQLService() if (r.service == this) { - if (r.interface) - r.interface->OnError(SQLResult("", "SQL Interface is going away")); + if (r.sqlinterface) + r.sqlinterface->OnError(SQLResult("", "SQL Interface is going away")); me->QueryRequests.erase(me->QueryRequests.begin() + i - 1); } } @@ -377,8 +377,8 @@ void DispatcherThread::Run() this->Lock(); if (!me->QueryRequests.empty() && me->QueryRequests.front().query == r.query) { - if (r.interface) - me->FinishedRequests.push_back(QueryResult(r.interface, sresult)); + if (r.sqlinterface) + me->FinishedRequests.push_back(QueryResult(r.sqlinterface, sresult)); me->QueryRequests.pop_front(); } } @@ -401,13 +401,13 @@ void MySQLPipe::OnNotify() { const QueryResult &qr = *it; - if (!qr.interface) + if (!qr.sqlinterface) throw SQLException("NULL qr.interface in MySQLPipe::OnNotify() ?"); if (qr.result.GetError().empty()) - qr.interface->OnResult(qr.result); + qr.sqlinterface->OnResult(qr.result); else - qr.interface->OnError(qr.result); + qr.sqlinterface->OnError(qr.result); } me->FinishedRequests.clear(); |