mirror of
https://github.com/curl/curl.git
synced 2026-08-09 05:54:22 +03:00
add and use beginthread/createthread macro for windowses
This commit is contained in:
parent
4d825c74d4
commit
57ff443a4c
5 changed files with 9 additions and 13 deletions
|
|
@ -643,9 +643,11 @@
|
|||
#if defined(CURL_WINDOWS_UWP) || defined(UNDER_CE)
|
||||
#define CURL_THREAD_RETURN_T DWORD
|
||||
typedef HANDLE curl_win_thread_handle_t;
|
||||
#define CURL_WIN_BEGINTHREAD CreateThread
|
||||
#else
|
||||
#define CURL_THREAD_RETURN_T unsigned int
|
||||
typedef uintptr_t curl_win_thread_handle_t;
|
||||
#define CURL_WIN_BEGINTHREAD _beginthreadex
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -135,11 +135,7 @@ curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
|
|||
{
|
||||
curl_thread_t t;
|
||||
curl_win_thread_handle_t thread_handle;
|
||||
#if defined(CURL_WINDOWS_UWP) || defined(UNDER_CE)
|
||||
thread_handle = CreateThread(NULL, 0, func, arg, 0, NULL);
|
||||
#else
|
||||
thread_handle = _beginthreadex(NULL, 0, func, arg, 0, NULL);
|
||||
#endif
|
||||
thread_handle = CURL_WIN_BEGINTHREAD(NULL, 0, func, arg, 0, NULL);
|
||||
t = (curl_thread_t)thread_handle;
|
||||
if((t == 0) || (t == LongToHandle(-1L))) {
|
||||
#ifdef UNDER_CE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue