From 0518d422c663ab0daf39c6113ea55f31303e8abd Mon Sep 17 00:00:00 2001 From: Deve Date: Sun, 1 Jul 2018 22:56:56 +0200 Subject: [PATCH] Fixed compilation --- src/main_loop.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main_loop.cpp b/src/main_loop.cpp index 04d52a218..d11fa890a 100644 --- a/src/main_loop.cpp +++ b/src/main_loop.cpp @@ -46,6 +46,19 @@ MainLoop* main_loop = 0; +#ifdef WIN32 +LRESULT CALLBACK separateProcessProc(_In_ HWND hwnd, _In_ UINT uMsg, + _In_ WPARAM wParam, _In_ LPARAM lParam) +{ + if (uMsg == WM_DESTROY) + { + PostQuitMessage(0); + return 0; + } + return DefWindowProc(hwnd, uMsg, wParam, lParam); +}; +#endif + // ---------------------------------------------------------------------------- MainLoop::MainLoop(unsigned parent_pid) : m_abort(false), m_parent_pid(parent_pid) @@ -62,15 +75,7 @@ MainLoop::MainLoop(unsigned parent_pid) class_name += StringUtils::toString(GetCurrentProcessId()); WNDCLASSEX wx = {}; wx.cbSize = sizeof(WNDCLASSEX); - wx.lpfnWndProc = [](HWND h, UINT m, WPARAM w, LPARAM l)->LRESULT - { - if (m == WM_DESTROY) - { - PostQuitMessage(0); - return 0; - } - return DefWindowProc(h, m, w, l); - }; + wx.lpfnWndProc = separateProcessProc; wx.hInstance = GetModuleHandle(0); wx.lpszClassName = &class_name[0]; if (RegisterClassEx(&wx))