]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_mysql.cpp
Attach to events and register services in init()
[user/henk/code/inspircd.git] / src / modules / extra / m_mysql.cpp
index 86d9273c3bc99f1d5d6b4990fed3fca984723026..08ec93cf2b324313f7fc2b13ee44bef8cb7770fe 100644 (file)
@@ -27,7 +27,7 @@
 #include <mysql.h>
 #include "sql.h"
 
-#ifdef WINDOWS
+#ifdef _WIN32
 # pragma comment(lib, "mysqlclient.lib")
 # pragma comment(lib, "advapi32.lib")
 # pragma comment(linker, "/NODEFAULTLIB:LIBCMT")
@@ -291,7 +291,7 @@ class SQLConnection : public SQLProvider
                {
                        /* XXX: See /usr/include/mysql/mysqld_error.h for a list of
                         * possible error numbers and error messages */
-                       SQLerror e(SQL_QREPLY_FAIL, ConvToStr(mysql_errno(connection)) + std::string(": ") + mysql_error(connection));
+                       SQLerror e(SQL_QREPLY_FAIL, ConvToStr(mysql_errno(connection)) + ": " + mysql_error(connection));
                        return new MySQLresult(e);
                }
        }
@@ -503,7 +503,7 @@ void DispatcherThread::Run()
                         */
 
                        this->LockQueue();
-                       if (Parent->qq.front().q == i.q)
+                       if (!Parent->qq.empty() && Parent->qq.front().q == i.q)
                        {
                                Parent->qq.pop_front();
                                Parent->rq.push_back(RQueueItem(i.q, res));