mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
[PLATFORM] MinGW support added
* disabled features unsupported by MinGW
* fixed issues with DLL_LINKAGE
! BOOST_THREAD_VERSION in now 3 workaround for existing code added, consider refactoring.
* some small tweaks ("-fpedantic" warnings)
This commit is contained in:
@@ -35,7 +35,7 @@ void CThreadHelper::processTasks()
|
||||
while(true)
|
||||
{
|
||||
{
|
||||
boost::unique_lock<boost::mutex> lock(rtinm);
|
||||
boost::unique_lock<boost::mutex> lock(rtinm);
|
||||
if((pom = currentTask) >= amount)
|
||||
break;
|
||||
else
|
||||
@@ -50,6 +50,7 @@ void CThreadHelper::processTasks()
|
||||
void setThreadName(const std::string &name)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifndef __GNUC__
|
||||
//follows http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
|
||||
const DWORD MS_VC_EXCEPTION=0x406D1388;
|
||||
#pragma pack(push,8)
|
||||
@@ -67,6 +68,7 @@ void setThreadName(const std::string &name)
|
||||
info.dwThreadID = -1;
|
||||
info.dwFlags = 0;
|
||||
|
||||
|
||||
__try
|
||||
{
|
||||
RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
|
||||
@@ -74,7 +76,11 @@ void setThreadName(const std::string &name)
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
}
|
||||
#else
|
||||
//not supported
|
||||
#endif
|
||||
|
||||
#else
|
||||
prctl(PR_SET_NAME, name.c_str(), 0, 0, 0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user