Skip to content

Commit

Permalink
Experimental MinGW support preparation: shared
Browse files Browse the repository at this point in the history
More strict windows preprocessor definitions
MinGW threading model detection
  • Loading branch information
Warlockbugs committed May 14, 2017
1 parent 0cff75e commit 8e58d23
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/shared/Database/DatabaseMysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bool MySQLConnection::Initialize(const char* infoString)
database = *iter++;

mysql_options(mysqlInit, MYSQL_SET_CHARSET_NAME, "utf8");
#ifdef WIN32
#ifdef _WIN32
if (host == ".") // named pipe use option (Windows)
{
unsigned int opt = MYSQL_PROTOCOL_PIPE;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/Database/DatabaseMysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "Database.h"
#include "Policies/Singleton.h"

#ifdef WIN32
#ifdef _WIN32
#include <mysql/mysql.h>
#else
#include <mysql.h>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/Database/DatabasePostgre.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "ace/Guard_T.h"
#include <stdarg.h>

#ifdef WIN32
#ifdef _WIN32
#define FD_SETSIZE 1024
#include <winsock2.h>
#include <postgre/libpq-fe.h>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/Database/QueryResultMysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "Common.h"

#ifdef WIN32
#ifdef _WIN32
#include <WinSock2.h>
#include <mysql/mysql.h>
#else
Expand Down
2 changes: 1 addition & 1 deletion src/shared/Database/QueryResultPostgre.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#if !defined(QUERYRESULTPOSTGRE_H)
#define QUERYRESULTPOSTGRE_H

#ifdef WIN32
#ifdef _WIN32
#define FD_SETSIZE 1024
#include <winsock2.h>
#include <postgre/libpq-fe.h>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ServiceWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifdef WIN32
#ifdef _WIN32

#include "Common.h"
#include "Log.h"
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ServiceWin32.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifdef WIN32
#ifdef _WIN32
#ifndef _WIN32_SERVICE_
#define _WIN32_SERVICE_

Expand Down
4 changes: 2 additions & 2 deletions src/shared/Threading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void Thread::setPriority(Priority priority)
{
std::thread::native_handle_type handle = m_ThreadImp.native_handle();
bool _ok = true;
#ifdef WIN32
#if defined(_WIN32) && !defined(__WINPTHREADS_VERSION)

switch (priority)
{
Expand Down Expand Up @@ -134,4 +134,4 @@ void Thread::setPriority(Priority priority)
void Thread::Sleep(unsigned long msecs)
{
std::this_thread::sleep_for(std::chrono::milliseconds(msecs));
}
}
2 changes: 1 addition & 1 deletion src/shared/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ uint32 CreatePIDFile(const std::string& filename)
if (pid_file == nullptr)
return 0;

#ifdef WIN32
#ifdef _WIN32
DWORD pid = GetCurrentProcessId();
#else
pid_t pid = getpid();
Expand Down

0 comments on commit 8e58d23

Please sign in to comment.