1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

curl_threads: fix MSVC compiler warning

Use LongToHandle to convert from long to HANDLE in the Win32
implementation.
This should fix the following warning when compiling with
MSVC 11 (2012) in 64-bit mode:
lib\curl_threads.c(113): warning C4306:
'type cast' : conversion from 'long' to 'HANDLE' of greater size

Closes https://github.com/curl/curl/pull/1717
This commit is contained in:
Marcel Raad 2017-08-01 11:56:41 +02:00
parent 62495ff31a
commit 0139545607
No known key found for this signature in database
GPG Key ID: 07ADACB610D796DA

View File

@ -110,7 +110,7 @@ curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void *),
#else #else
t = (curl_thread_t)_beginthreadex(NULL, 0, func, arg, 0, NULL); t = (curl_thread_t)_beginthreadex(NULL, 0, func, arg, 0, NULL);
#endif #endif
if((t == 0) || (t == (curl_thread_t)-1L)) { if((t == 0) || (t == LongToHandle(-1L))) {
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
DWORD gle = GetLastError(); DWORD gle = GetLastError();
errno = ((gle == ERROR_ACCESS_DENIED || errno = ((gle == ERROR_ACCESS_DENIED ||