From 57c52eebce27bd104ae130e72c3833f361b11919 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 21 Feb 2018 07:26:00 -0800 Subject: [PATCH] MinGW requires lambdas to set their calling method if needed --- src/core/lib/gprpp/thd_windows.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/lib/gprpp/thd_windows.cc b/src/core/lib/gprpp/thd_windows.cc index ce7d3298a65..6e2095fe036 100644 --- a/src/core/lib/gprpp/thd_windows.cc +++ b/src/core/lib/gprpp/thd_windows.cc @@ -31,8 +31,10 @@ #if defined(_MSC_VER) #define thread_local __declspec(thread) +#define WIN_LAMBDA #elif defined(__GNUC__) #define thread_local __thread +#define WIN_LAMBDA WINAPI #else #error "Unknown compiler - please file a bug report" #endif @@ -81,7 +83,7 @@ Thread::Thread(const char* thd_name, void (*thd_body)(void* arg), void* arg, alive_ = false; } else { handle = CreateThread(nullptr, 64 * 1024, - [](void* v) -> DWORD { + [](void* v) WIN_LAMBDA -> DWORD { g_thd_info = static_cast(v); gpr_mu_lock(&g_thd_info->thread->mu_); if (!g_thd_info->thread->started_) {