From ea698aef458d8fb80b8ac23f6a4f84c07027dff4 Mon Sep 17 00:00:00 2001 From: mingkuang Date: Sun, 4 Aug 2024 23:54:51 +0800 Subject: [PATCH] =?UTF-8?q?Bug=20#67,=20=5F=5F=5Flc=5Flocale=5Fname=5Ffunc?= =?UTF-8?q?=E6=94=B9=E7=94=A8Tls=E5=AE=9E=E7=8E=B0=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B3XP=E7=9B=AE=E6=A0=87=E6=97=B6=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=8D=A0=E7=94=A8=E8=BF=87=E5=A4=9A=E5=86=85?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Nuget/VC-LTL.nuspec | 7 +++---- ucrtbase.msvcrt/initctype.cpp | 13 +++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Nuget/VC-LTL.nuspec b/Nuget/VC-LTL.nuspec index 34c12e6..cc489b0 100644 --- a/Nuget/VC-LTL.nuspec +++ b/Nuget/VC-LTL.nuspec @@ -3,7 +3,6 @@ VC-LTL $version$ - VC-LTL for Visual Studio 2015, 2017, 2019, 2022 VC-LTL for Visual Studio 2015, 2017, 2019, 2022,编译精巧的程序原来如此简单。 YY 初雨团队 @@ -26,11 +25,11 @@ - - + + - + diff --git a/ucrtbase.msvcrt/initctype.cpp b/ucrtbase.msvcrt/initctype.cpp index c488079..a126939 100644 --- a/ucrtbase.msvcrt/initctype.cpp +++ b/ucrtbase.msvcrt/initctype.cpp @@ -23,15 +23,8 @@ struct lc_locale_name_buffer EXTERN_C wchar_t** __cdecl ___lc_locale_name_func(void) { -#if WindowsTargetPlatformMinVersion < WindowsTargetPlatformWindows6 - //XP系统 thread_local 存在限制,所以我们需要在本地弄一份很大的数组,对于这个场景很显然我们不需要太强大散列支持 - static lc_locale_name_buffer ThreadBuffer[0x4000]; - - auto& Current = ThreadBuffer[(GetCurrentThreadId() >> 1) % __crt_countof(ThreadBuffer)]; -#else - static thread_local lc_locale_name_buffer Current; -#endif - + // 由YY-Thunks 为Windows XP提供完整的TLS支持 + static thread_local lc_locale_name_buffer Current; auto lc_handle = ___lc_handle_func(); @@ -68,4 +61,4 @@ EXTERN_C unsigned int __cdecl ___lc_collate_cp_func(void) _LCRT_DEFINE_IAT_SYMBOL(___lc_collate_cp_func); -#endif \ No newline at end of file +#endif