From 68ca92c2f5610d608b77f94e793742cc01cee70c Mon Sep 17 00:00:00 2001 From: mingkuang Date: Thu, 25 Jul 2024 23:00:54 +0800 Subject: [PATCH] =?UTF-8?q?Bug=20#107,=20=E4=BB=8E=E6=A0=B9=E6=BA=90?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BE=9D=E8=B5=96threadSafeInit=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Build.cmd | 4 ++-- src/Thunks/api-ms-win-core-threadpool.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Build.cmd b/src/Build.cmd index b05dbeb..0e49347 100644 --- a/src/Build.cmd +++ b/src/Build.cmd @@ -26,7 +26,7 @@ goto:eof :BuildObj echo BuildObj %1 %2 %3 -cl /O1 /Os /Oi /GS- /std:c++17 /execution-charset:utf-8 /Zc:threadSafeInit- /Zc:sizedDealloc- /Zc:tlsGuards- /Zc:alignedNew- /arch:IA32 /Z7 /MT /Fo"objs\\%Platform%\\%1" /Zl /c /D "NDEBUG" /D "YY_Thunks_Target=%2" "%~dp0Thunks\YY_Thunks.cpp" +cl /O1 /Os /Oi /GS- /std:c++17 /execution-charset:utf-8 /Zc:sizedDealloc- /Zc:tlsGuards- /Zc:alignedNew- /arch:IA32 /Z7 /MT /Fo"objs\\%Platform%\\%1" /Zl /c /D "NDEBUG" /D "YY_Thunks_Target=%2" "%~dp0Thunks\YY_Thunks.cpp" if %ErrorLevel% NEQ 0 exit /b %ErrorLevel% ::生成weak符号,一些非必须符号安排为weak可以避免链接失败 @@ -52,7 +52,7 @@ echo BuildLib %1 %2 %3 md "Lib\\%1\\%Platform%" -cl /O1 /Os /Oi /GS- /std:c++17 /execution-charset:utf-8 /Zc:threadSafeInit- /Zc:sizedDealloc- /Zc:tlsGuards- /Zc:alignedNew- /arch:IA32 /Z7 /MT /Fo"Lib\\%1\\%Platform%\\YY_Thunks_for_%1.obj" /Zl /c /D "__APPLY_CHROMIUM_WORKAROUNDS" /D "__USING_NTDLL_LIB" /D "NDEBUG" /D "YY_Thunks_Target=%2" /D "__FALLBACK_PREFIX=YY_Thunks_" "%~dp0Thunks\YY_Thunks.cpp" +cl /O1 /Os /Oi /GS- /std:c++17 /execution-charset:utf-8 /Zc:sizedDealloc- /Zc:tlsGuards- /Zc:alignedNew- /arch:IA32 /Z7 /MT /Fo"Lib\\%1\\%Platform%\\YY_Thunks_for_%1.obj" /Zl /c /D "__APPLY_CHROMIUM_WORKAROUNDS" /D "__USING_NTDLL_LIB" /D "NDEBUG" /D "YY_Thunks_Target=%2" /D "__FALLBACK_PREFIX=YY_Thunks_" "%~dp0Thunks\YY_Thunks.cpp" if %ErrorLevel% NEQ 0 exit /b %ErrorLevel% diff --git a/src/Thunks/api-ms-win-core-threadpool.hpp b/src/Thunks/api-ms-win-core-threadpool.hpp index f947b1e..db88c49 100644 --- a/src/Thunks/api-ms-win-core-threadpool.hpp +++ b/src/Thunks/api-ms-win-core-threadpool.hpp @@ -344,7 +344,7 @@ namespace YY::Thunks::Fallback static_assert(sizeof(TaskRunnerFlags) == sizeof(uint64_t)); public: - TP_Pool(bool _bDefault = false) + constexpr TP_Pool(bool _bDefault = false) : uRef(_bDefault ? UINT32_MAX : 1) { }