From f95319b6524aaabcefc2fa3bcedeeb0e984fcf21 Mon Sep 17 00:00:00 2001 From: Taojunshen Date: Sat, 6 Aug 2022 01:32:53 +0800 Subject: [PATCH] 8/5/2022 AM Publish (#4454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * crtsetdbgflag.md: _CrtCheckMemory is not called by default * Visual C++ 17.0 has unlimited string literals * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Taojunshen Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Tyler Whitney * wordsmith * clarify wording * wording * Update .openpublishing.publish.config.json * Repo sync for protected CLA branch (#4061) * add initial doc stubs * Initial docs push, contains stubs for some files and a stub for a landing page * update some links * add more cards and links to the Hub page * fix error * remove monikor's so it's easy to test, fix rtos-view.md path * fix link * add more to the sidebar * update peripheral view by consolidating to the table, change things to objects in rtos-view * add tabs * forgot to end tabbed section * fix items after adding tabs * update h1 * slightly fix some wording * add link from C++ and C workloads, features, and libraries to embedded hub * move into own directory so that the url is better * fix some warnings * remove next steps that pointed to linux items * prefer tabbed view vs table * attempt to add moniker * attempt highest moniker in range * assign to a specific version * push again to get new build * add '=' sign to try and test it * add metadata for msvc-170 * add moniker range for index.yml * remove inline moniker since we only need it on the files themselves * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown * Edit pass for house style * add 'while debugging' for peripheral-view * Fix table issue, stray punctuation Co-authored-by: Garrett Campbell Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: Alma Jenks * Update ios-functions.md fix typo (#4071) showps→showpos * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4442) * 7/27/2022 AM Publish (#4432) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Taojunshen Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Tyler Whitney * wordsmith * clarify wording * wording Co-authored-by: Feng Xu Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Tyler Whitney Co-authored-by: TylerMSFT Co-authored-by: PRMerger20 * 7/28/2022 AM Publish (#4437) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Taojunshen Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Tyler Whitney * wordsmith * clarify wording * wording Co-authored-by: Feng Xu Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Tyler Whitney Co-authored-by: TylerMSFT Co-authored-by: PRMerger20 * 7/29/2022 AM Publish (#4441) * Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (#4430) * 7/19/2022 AM Publish (#4424) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * 7/20/2022 AM Publish (#4426) * Follow up 4221 Acrolinx score for TN035 * Fix heading style Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * 7/21/2022 AM Publish (#4427) * Follow up 4221 Acrolinx score for TN035 * Fix heading style * Update C++-specific template info * Fix links to raw and rendered markdown Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> * crtsetdbgflag.md: _CrtCheckMemory is not called by default Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Taojunshen Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Tyler Whitney * wordsmith * clarify wording * wording Co-authored-by: Feng Xu Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Tyler Whitney Co-authored-by: TylerMSFT Co-authored-by: PRMerger20 Co-authored-by: Alma Jenks Co-authored-by: Taojunshen Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Tyler Whitney Co-authored-by: TylerMSFT Co-authored-by: PRMerger20 * Address cpp-docs 4075 __assume issues * Address cpp-docs 4072 clarity issue * update date * Update multithreading-and-locales.md Wrong `setlocale()` reference, it should be a C runtime function, not a preprocessor macro. * Update for consistent branding. Co-authored-by: Colin Robertson <3836425+corob-msft@users.noreply.github.com> Co-authored-by: opbld16 Co-authored-by: opbld15 Co-authored-by: opbld17 Co-authored-by: Oliver Old Co-authored-by: Igor Zhukov Co-authored-by: Tyler Whitney Co-authored-by: Feng Xu Co-authored-by: JiayueHu <36248303+JiayueHu@users.noreply.github.com> Co-authored-by: Bryan Gold <101299717+19BMG00@users.noreply.github.com> Co-authored-by: TylerMSFT Co-authored-by: PRMerger20 Co-authored-by: irushx <39490127+irushx@users.noreply.github.com> Co-authored-by: Garrett Campbell Co-authored-by: Alma Jenks Co-authored-by: pea-sys <49807271+pea-sys@users.noreply.github.com> Co-authored-by: PRMerger7 Co-authored-by: Anton --- docs/cpp/string-and-character-literals-cpp.md | 2 +- docs/parallel/multithreading-and-locales.md | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/cpp/string-and-character-literals-cpp.md b/docs/cpp/string-and-character-literals-cpp.md index 561a75d2728..7e4437779b9 100644 --- a/docs/cpp/string-and-character-literals-cpp.md +++ b/docs/cpp/string-and-character-literals-cpp.md @@ -331,7 +331,7 @@ const size_t byteSize = (wcslen(str) + 1) * sizeof(wchar_t); Notice that `strlen()` and `wcslen()` don't include the size of the terminating null character, whose size is equal to the element size of the string type: one byte on a `char*` or `char8_t*` string, two bytes on `wchar_t*` or `char16_t*` strings, and four bytes on `char32_t*` strings. -The maximum length of a string literal is 65,535 bytes. This limit applies to both narrow string literals and wide string literals. +In versions of Visual Studio before Visual Studio 2022 version 17.0, the maximum length of a string literal is 65,535 bytes. This limit applies to both narrow string literals and wide string literals. In Visual Studio 2022 version 17.0 and later, this restriction is lifted and string length is limited by available resources. ### Modifying string literals diff --git a/docs/parallel/multithreading-and-locales.md b/docs/parallel/multithreading-and-locales.md index 9c370107b00..8df3ba928ec 100644 --- a/docs/parallel/multithreading-and-locales.md +++ b/docs/parallel/multithreading-and-locales.md @@ -13,20 +13,20 @@ Both the C Runtime Library and the C++ Standard Library provide support for chan With the C Runtime Library, you can create multithreaded applications using the `_beginthread` and `_beginthreadex` functions. This topic only covers multithreaded applications created using these functions. For more information, see [_beginthread, _beginthreadex](../c-runtime-library/reference/beginthread-beginthreadex.md). -To change the locale using the C Runtime Library, use the [setlocale](../preprocessor/setlocale.md) function. In previous versions of Visual C++, this function would always modify the locale throughout the entire application. There is now support for setting the locale on a per-thread basis. This is done using the [_configthreadlocale](../c-runtime-library/reference/configthreadlocale.md) function. To specify that [setlocale](../preprocessor/setlocale.md) should only change the locale in the current thread, call `_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)` in that thread. Conversely, calling `_configthreadlocale(_DISABLE_PER_THREAD_LOCALE)` will cause that thread to use the global locale, and any call to [setlocale](../preprocessor/setlocale.md) in that thread will change the locale in all threads that have not explicitly enabled per-thread locale. +To change the locale using the C Runtime Library, use the [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) function. In previous versions of Visual C++, this function would always modify the locale throughout the entire application. There is now support for setting the locale on a per-thread basis. This is done using the [_configthreadlocale](../c-runtime-library/reference/configthreadlocale.md) function. To specify that [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) should only change the locale in the current thread, call `_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)` in that thread. Conversely, calling `_configthreadlocale(_DISABLE_PER_THREAD_LOCALE)` will cause that thread to use the global locale, and any call to [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) in that thread will change the locale in all threads that have not explicitly enabled per-thread locale. To change the locale using the C++ Runtime Library, use the [locale Class](../standard-library/locale-class.md). By calling the [locale::global](../standard-library/locale-class.md#global) method, you change the locale in every thread that has not explicitly enabled per-thread locale. To change the locale in a single thread or portion of an application, simply create an instance of a `locale` object in that thread or portion of code. > [!NOTE] -> Calling [locale::global](../standard-library/locale-class.md#global) changes the locale for both the C++ Standard Library and the C Runtime Library. However, calling [setlocale](../preprocessor/setlocale.md) only changes the locale for the C Runtime Library; the C++ Standard Library is not affected. +> Calling [locale::global](../standard-library/locale-class.md#global) changes the locale for both the C++ Standard Library and the C Runtime Library. However, calling [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) only changes the locale for the C Runtime Library; the C++ Standard Library is not affected. -The following examples show how to use the [setlocale](../preprocessor/setlocale.md) function, the [locale Class](../standard-library/locale-class.md), and the [_configthreadlocale](../c-runtime-library/reference/configthreadlocale.md) function to change the locale of an application in several different scenarios. +The following examples show how to use the [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) function, the [locale Class](../standard-library/locale-class.md), and the [_configthreadlocale](../c-runtime-library/reference/configthreadlocale.md) function to change the locale of an application in several different scenarios. ## Example: Change locale with per-thread locale enabled -In this example, the main thread spawns two child threads. The first thread, Thread A, enables per-thread locale by calling `_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)`. The second thread, Thread B, as well as the main thread, do not enable per-thread locale. Thread A then proceeds to change the locale using the [setlocale](../preprocessor/setlocale.md) function of the C Runtime Library. +In this example, the main thread spawns two child threads. The first thread, Thread A, enables per-thread locale by calling `_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)`. The second thread, Thread B, as well as the main thread, do not enable per-thread locale. Thread A then proceeds to change the locale using the [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) function of the C Runtime Library. -Since Thread A has per-thread locale enabled, only the C Runtime Library functions in Thread A start using the "french" locale. The C Runtime Library functions in Thread B and in the main thread continue to use the "C" locale. Also, since [setlocale](../preprocessor/setlocale.md) does not affect the C++ Standard Library locale, all C++ Standard Library objects continue to use the "C" locale. +Since Thread A has per-thread locale enabled, only the C Runtime Library functions in Thread A start using the "french" locale. The C Runtime Library functions in Thread B and in the main thread continue to use the "C" locale. Also, since [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) does not affect the C++ Standard Library locale, all C++ Standard Library objects continue to use the "C" locale. ```cpp // multithread_locale_1.cpp @@ -222,9 +222,9 @@ unsigned __stdcall RunThreadB(void *params) ## Example: Change locale without per-thread locale enabled -In this example, the main thread spawns two child threads. The first thread, Thread A, enables per-thread locale by calling `_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)`. The second thread, Thread B, as well as the main thread, do not enable per-thread locale. Thread B then proceeds to change the locale using the [setlocale](../preprocessor/setlocale.md) function of the C Runtime Library. +In this example, the main thread spawns two child threads. The first thread, Thread A, enables per-thread locale by calling `_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)`. The second thread, Thread B, as well as the main thread, do not enable per-thread locale. Thread B then proceeds to change the locale using the [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) function of the C Runtime Library. -Since Thread B does not have per-thread locale enabled, the C Runtime Library functions in Thread B and in the main thread start using the "french" locale. The C Runtime Library functions in Thread A continue to use the "C" locale because Thread A has per-thread locale enabled. Also, since [setlocale](../preprocessor/setlocale.md) does not affect the C++ Standard Library locale, all C++ Standard Library objects continue to use the "C" locale. +Since Thread B does not have per-thread locale enabled, the C Runtime Library functions in Thread B and in the main thread start using the "french" locale. The C Runtime Library functions in Thread A continue to use the "C" locale because Thread A has per-thread locale enabled. Also, since [setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md) does not affect the C++ Standard Library locale, all C++ Standard Library objects continue to use the "C" locale. ```cpp // multithread_locale_3.cpp @@ -431,7 +431,7 @@ unsigned __stdcall RunThreadB(void *params) [Multithreading Support for Older Code (Visual C++)](multithreading-support-for-older-code-visual-cpp.md)
[_beginthread, _beginthreadex](../c-runtime-library/reference/beginthread-beginthreadex.md)
[_configthreadlocale](../c-runtime-library/reference/configthreadlocale.md)
-[setlocale](../preprocessor/setlocale.md)
+[setlocale](../c-runtime-library/reference/setlocale-wsetlocale.md)
[Internationalization](../c-runtime-library/internationalization.md)
[Locale](../c-runtime-library/locale.md)
[\](../standard-library/clocale.md)