mirror of
https://github.com/curl/curl.git
synced 2026-06-15 04:05:36 +03:00
add and use thread callconv macro
This commit is contained in:
parent
821d6c0a29
commit
784fc23958
5 changed files with 8 additions and 4 deletions
|
|
@ -642,11 +642,13 @@
|
|||
|
||||
#if defined(CURL_WINDOWS_UWP) || defined(UNDER_CE)
|
||||
#define CURL_THREAD_RETURN_T DWORD
|
||||
#define CURL_WIN_THREADFUNC WINAPI
|
||||
typedef HANDLE curl_win_thread_handle_t;
|
||||
#define CURL_WIN_BEGINTHREAD CreateThread
|
||||
#else
|
||||
#define CURL_THREAD_RETURN_T unsigned int
|
||||
#ifdef _WIN32
|
||||
#define CURL_WIN_THREADFUNC __stdcall
|
||||
typedef uintptr_t curl_win_thread_handle_t;
|
||||
#define CURL_WIN_BEGINTHREAD _beginthreadex
|
||||
#endif /* _WIN32 */
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
# define Curl_mutex_release(m) pthread_mutex_unlock(m)
|
||||
# define Curl_mutex_destroy(m) pthread_mutex_destroy(m)
|
||||
#elif defined(USE_THREADS_WIN32)
|
||||
# define CURL_STDCALL __stdcall
|
||||
# define CURL_STDCALL CURL_WIN_THREADFUNC
|
||||
# define curl_mutex_t CRITICAL_SECTION
|
||||
# define curl_thread_t HANDLE
|
||||
# define curl_thread_t_null (HANDLE)0
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
#include <process.h>
|
||||
static CURL_THREAD_RETURN_T __stdcall t3026_run_thread(void *ptr)
|
||||
static CURL_THREAD_RETURN_T CURL_WIN_THREADFUNC t3026_run_thread(void *ptr)
|
||||
{
|
||||
CURLcode *result = ptr;
|
||||
|
||||
|
|
|
|||
|
|
@ -413,7 +413,8 @@ struct select_ws_wait_data {
|
|||
HANDLE abort; /* internal event to abort waiting threads */
|
||||
};
|
||||
#include <process.h>
|
||||
static unsigned int WINAPI select_ws_wait_thread(void *lpParameter)
|
||||
static
|
||||
unsigned int CURL_WIN_THREADFUNC select_ws_wait_thread(void *lpParameter)
|
||||
{
|
||||
struct select_ws_wait_data *data;
|
||||
HANDLE signal, handle, handles[2];
|
||||
|
|
|
|||
|
|
@ -488,7 +488,8 @@ static LRESULT CALLBACK main_window_proc(HWND hwnd, UINT uMsg,
|
|||
/* Window message queue loop for hidden main window, details see above.
|
||||
*/
|
||||
#include <process.h>
|
||||
static CURL_THREAD_RETURN_T WINAPI main_window_loop(void *lpParameter)
|
||||
static
|
||||
CURL_THREAD_RETURN_T CURL_WIN_THREADFUNC main_window_loop(void *lpParameter)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
BOOL ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue