diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-23 01:42:22 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-23 01:42:22 +0200 |
commit | 74b9361ccc77bcbb6b8188ad5914d6b26530d26a (patch) | |
tree | dcae529eafee0666a799fd3377ee66e81ad41e26 | |
parent | 01124be71c818a6ac39f55d1a0eed6235864855f (diff) | |
download | EpisodeBrowser-74b9361ccc77bcbb6b8188ad5914d6b26530d26a.tar.gz |
Use thread_local instead of __thread.
-rw-r--r-- | c/win.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; |