Commit 3e54404c authored by Ilya Biryukov's avatar Ilya Biryukov
Browse files

[Support] fix mingw-w64 build

Older versions of Mingw-w64 do not define _beginthreadex_proc_type,
so we replace it with `unsigned (__stdcall *ThreadFunc)(void *)`.

Fixes https://github.com/clangd/clangd/issues/188

Patch by lh123!

Differential Revision: https://reviews.llvm.org/D69879
parent eabd405e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ static unsigned __stdcall threadFuncAsync(void *Arg) {
}

static void
llvm_execute_on_thread_impl(_beginthreadex_proc_type ThreadFunc, void *Arg,
llvm_execute_on_thread_impl(unsigned (__stdcall *ThreadFunc)(void *), void *Arg,
                            llvm::Optional<unsigned> StackSizeInBytes,
                            JoiningPolicy JP) {
  HANDLE hThread = (HANDLE)::_beginthreadex(