add and use thread callconv macro

This commit is contained in:
Viktor Szakats 2025-08-01 22:38:21 +02:00
parent 821d6c0a29
commit 784fc23958
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 8 additions and 4 deletions

View file

@ -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 */

View file

@ -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