From 74b9361ccc77bcbb6b8188ad5914d6b26530d26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 23 Aug 2022 01:42:22 +0200 Subject: Use thread_local instead of __thread. --- c/win.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'c/win.cpp') diff --git a/c/win.cpp b/c/win.cpp index a09b19b..e8c429d 100644 --- a/c/win.cpp +++ b/c/win.cpp @@ -18,8 +18,8 @@ void WithNextWindow(void (*proc)(HWND)) * that static storage must be used, as SetWindowHookEx cannot * accept a capturing lambda as the hook procedure. */ - static __thread auto procNext = proc; - static __thread HHOOK hHook = Require(SetWindowsHookEx(WH_CBT, [](const int nCode, + static thread_local auto procNext = proc; + static thread_local HHOOK hHook = Require(SetWindowsHookEx(WH_CBT, [](const int nCode, const WPARAM wParam, const LPARAM lParam) -> LRESULT CALLBACK { if (nCode == HCBT_CREATEWND) { @@ -42,9 +42,9 @@ static void CenterNextWindow(HWND hWnd) * is delayed until the new window is activated. This * complicates the code somewhat. */ - static __thread HWND hWndParent; - static __thread HWND hWndNext; - static __thread HHOOK hHook; + static thread_local HWND hWndParent; + static thread_local HWND hWndNext; + static thread_local HHOOK hHook; hWndParent = hWnd; hWndNext = nullptr; -- cgit v1.2.3