*: check defined(_WIN32) instead of defined(WIN32)
Only _WIN32 is defined by the compiler, and WIN32 is not standardized and may be missing. Closes #169
This commit is contained in:
@@ -33,7 +33,7 @@ Thread::Start(void (*_f)(void *ctx), void *_ctx)
|
||||
f = _f;
|
||||
ctx = _ctx;
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
handle = ::CreateThread(nullptr, 0, ThreadProc, this, 0, &id);
|
||||
if (handle == nullptr)
|
||||
throw MakeLastError("Failed to create thread");
|
||||
@@ -66,7 +66,7 @@ Thread::Join()
|
||||
assert(IsDefined());
|
||||
assert(!IsInside());
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
::WaitForSingleObject(handle, INFINITE);
|
||||
::CloseHandle(handle);
|
||||
handle = nullptr;
|
||||
@@ -76,7 +76,7 @@ Thread::Join()
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
|
||||
DWORD WINAPI
|
||||
Thread::ThreadProc(LPVOID ctx)
|
||||
|
Reference in New Issue
Block a user