Fix compilation

This commit is contained in:
Lynix 2017-06-20 08:28:57 +02:00
parent 90d86c6eb0
commit 175a98c4fc
2 changed files with 6 additions and 2 deletions

View File

@ -8,8 +8,9 @@
#define NAZARA_THREADIMPL_HPP #define NAZARA_THREADIMPL_HPP
#include <Nazara/Prerequesites.hpp> #include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/String.hpp>
#ifdef __GNUC__ #if defined(__GNUC__) && !defined(_GNU_SOURCE)
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif

View File

@ -26,9 +26,12 @@ namespace Nz
ThreadImpl::ThreadImpl(Functor* functor) ThreadImpl::ThreadImpl(Functor* functor)
{ {
m_handle = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0, &ThreadImpl::ThreadProc, functor, 0, &m_threadId)); unsigned int threadId;
m_handle = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, 0, &ThreadImpl::ThreadProc, functor, 0, &threadId));
if (!m_handle) if (!m_handle)
NazaraInternalError("Failed to create thread: " + Error::GetLastSystemError()); NazaraInternalError("Failed to create thread: " + Error::GetLastSystemError());
m_threadId = threadId;
} }
void ThreadImpl::Detach() void ThreadImpl::Detach()