mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Fix building on Windows (mostly).
This commit is contained in:
parent
36e6dc7bc8
commit
d2efdbf6bb
2
.gitignore
vendored
2
.gitignore
vendored
@ -28,3 +28,5 @@
|
||||
/src/modules/m_ssl_mbedtls.cpp
|
||||
/src/modules/m_ssl_openssl.cpp
|
||||
|
||||
/win/Win32
|
||||
/win/*.dir
|
||||
|
@ -1216,34 +1216,12 @@ struct AllModuleList {
|
||||
* and functions needed to make a module loadable by the OS.
|
||||
* It defines the class factory and external init_module function.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
|
||||
#define MODULE_INIT(y) \
|
||||
extern "C" DllExport Module * MODULE_INIT_SYM() \
|
||||
{ \
|
||||
return new y; \
|
||||
} \
|
||||
BOOLEAN WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved) \
|
||||
{ \
|
||||
switch ( nReason ) \
|
||||
{ \
|
||||
case DLL_PROCESS_ATTACH: \
|
||||
case DLL_PROCESS_DETACH: \
|
||||
break; \
|
||||
} \
|
||||
return TRUE; \
|
||||
} \
|
||||
extern "C" DllExport const char inspircd_src_version[] = INSPIRCD_VERSION;
|
||||
|
||||
#else
|
||||
|
||||
#define MODULE_INIT(y) \
|
||||
extern "C" DllExport Module * MODULE_INIT_SYM() \
|
||||
{ \
|
||||
return new y; \
|
||||
} \
|
||||
extern "C" DllExport const char inspircd_src_version[] = INSPIRCD_VERSION;
|
||||
#endif
|
||||
|
||||
#define COMMAND_INIT(c) MODULE_INIT(CommandModule<c>)
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/** Shun class
|
||||
*/
|
||||
class CoreExport Shun : public XLine
|
||||
class Shun : public XLine
|
||||
{
|
||||
public:
|
||||
/** Create a Shun.
|
||||
|
@ -42,7 +42,7 @@ namespace SQL
|
||||
enum ErrorCode
|
||||
{
|
||||
/** No error has occurred. */
|
||||
NO_ERROR,
|
||||
SUCCESS,
|
||||
|
||||
/** The database identifier is invalid. */
|
||||
BAD_DBID,
|
||||
|
@ -145,7 +145,7 @@ class MySQLresult : public SQL::Result
|
||||
std::vector<std::string> colnames;
|
||||
std::vector<SQL::Row> fieldlists;
|
||||
|
||||
MySQLresult(MYSQL_RES* res, int affected_rows) : err(SQL::NO_ERROR), currentrow(0), rows(0)
|
||||
MySQLresult(MYSQL_RES* res, int affected_rows) : err(SQL::SUCCESS), currentrow(0), rows(0)
|
||||
{
|
||||
if (affected_rows >= 1)
|
||||
{
|
||||
@ -541,7 +541,7 @@ void DispatcherThread::OnNotify()
|
||||
for(ResultQueue::iterator i = Parent->rq.begin(); i != Parent->rq.end(); i++)
|
||||
{
|
||||
MySQLresult* res = i->r;
|
||||
if (res->err.code == SQL::NO_ERROR)
|
||||
if (res->err.code == SQL::SUCCESS)
|
||||
i->q->OnResult(*res);
|
||||
else
|
||||
i->q->OnError(res->err);
|
||||
|
@ -71,6 +71,9 @@ void SocketEngine::InitError()
|
||||
|
||||
void SocketEngine::LookupMaxFds()
|
||||
{
|
||||
#if defined _WIN32
|
||||
MaxSetSize = FD_SETSIZE;
|
||||
#else
|
||||
struct rlimit limits;
|
||||
if (!getrlimit(RLIMIT_NOFILE, &limits))
|
||||
MaxSetSize = limits.rlim_cur;
|
||||
@ -82,6 +85,7 @@ void SocketEngine::LookupMaxFds()
|
||||
#endif
|
||||
if (!setrlimit(RLIMIT_NOFILE, &limits))
|
||||
MaxSetSize = limits.rlim_cur;
|
||||
#endif
|
||||
}
|
||||
|
||||
void SocketEngine::ChangeEventMask(EventHandler* eh, int change)
|
||||
|
@ -23,6 +23,7 @@ file(STRINGS "${INSPIRCD_BASE}/src/version.sh" VERSIONSH)
|
||||
string(REGEX REPLACE ".*InspIRCd-([0-9]*).*" "\\1" VERSION_MAJOR "${VERSIONSH}")
|
||||
string(REGEX REPLACE ".*InspIRCd-[0-9]*\\.([0-9]*).*" "\\1" VERSION_MINOR "${VERSIONSH}")
|
||||
string(REGEX REPLACE ".*InspIRCd-[0-9]*\\.[0-9]*\\.([0-9]*).*" "\\1" VERSION_PATCH "${VERSIONSH}")
|
||||
string(REGEX REPLACE ".*InspIRCd-([^\"]+).*" "\\1" VERSION_FULL "${VERSIONSH}")
|
||||
|
||||
if(MSVC)
|
||||
# Without /SAFESEH:NO old libraries compiled with VS 2010 or older won't link correctly to VS2012 (eg, extra module libs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user