Unverified Commit 7ae78fee authored by Marcel Raad's avatar Marcel Raad
Browse files

curl_threads: fix classic MinGW compile break

parent 5616c1df
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -104,13 +104,21 @@ int Curl_thread_join(curl_thread_t *hnd)
curl_thread_t Curl_thread_create(unsigned int (CURL_STDCALL *func) (void *),
                                 void *arg)
{
#ifdef _WIN32_WCE
  typedef HANDLE curl_win_thread_handle_t;
#elif defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
  typedef unsigned long curl_win_thread_handle_t;
#else
  typedef uintptr_t curl_win_thread_handle_t;
#endif
  curl_thread_t t;
  curl_win_thread_handle_t thread_handle;
#ifdef _WIN32_WCE
  t = CreateThread(NULL, 0, func, arg, 0, NULL);
  thread_handle = CreateThread(NULL, 0, func, arg, 0, NULL);
#else
  uintptr_t thread_handle = _beginthreadex(NULL, 0, func, arg, 0, NULL);
  t = (curl_thread_t)thread_handle;
  thread_handle = _beginthreadex(NULL, 0, func, arg, 0, NULL);
#endif
  t = (curl_thread_t)thread_handle;
  if((t == 0) || (t == LongToHandle(-1L))) {
#ifdef _WIN32_WCE
    DWORD gle = GetLastError();