1 From 60cb8e07b17ad8533d7d13f52435aa11e48f4659 Mon Sep 17 00:00:00 2001
2 From: Dimitry Sibiryakov <sd@ibphoenix.com>
3 Date: Tue, 12 Nov 2019 13:42:49 +0100
4 Subject: [PATCH] Fix warning on Win64 build (#231)
7 src/common/ThreadStart.cpp | 11 +++++++----
8 1 file changed, 7 insertions(+), 4 deletions(-)
10 diff --git a/src/common/ThreadStart.cpp b/src/common/ThreadStart.cpp
11 index 184c93a32b..758056432f 100644
12 --- a/src/common/ThreadStart.cpp
13 +++ b/src/common/ThreadStart.cpp
14 @@ -309,13 +309,16 @@ Thread Thread::start(ThreadEntryPoint* routine, void* arg, int priority_arg, Han
15 * Advanced Windows by Richter pg. # 109. */
18 - unsigned long real_handle =
19 - _beginthreadex(NULL, 0, THREAD_ENTRYPOINT, THREAD_ARG, CREATE_SUSPENDED, &thread_id);
22 + reinterpret_cast<HANDLE>(_beginthreadex(NULL, 0, THREAD_ENTRYPOINT, THREAD_ARG, CREATE_SUSPENDED, &thread_id));
25 + // Though MSDN says that _beginthreadex() returns error in errno,
26 + // GetLastError() still works because RTL call no other system
27 + // functions after CreateThread() in the case of error.
28 + // Watch out if it is ever changed.
29 Firebird::system_call_failed::raise("_beginthreadex", GetLastError());
31 - HANDLE handle = reinterpret_cast<HANDLE>(real_handle);
33 SetThreadPriority(handle, priority);