You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/reference/opt-optimizations.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ By default, the **/OPT:LBR** option is set when incremental linking is not enabl
48
48
49
49
## Remarks
50
50
51
-
When used at the command line, the linker defaults to **/OPT:REF,ICF,LBR**. If **/DEBUG** is specified, the default is **/OPT:NOREF,NOICR,NOLBR**.
51
+
When used at the command line, the linker defaults to **/OPT:REF,ICF,LBR**. If **/DEBUG** is specified, the default is **/OPT:NOREF,NOICF,NOLBR**.
52
52
53
53
The **/OPT** optimizations generally decrease the image size and increase the program speed. These improvements can be substantial in larger programs, which is why they are enabled by default for retail builds.
- For flexibility, use run-time macros such as `_tcschr` and `_tcscpy` when possible. For more information, see [Generic-Text Mappings in Tchar.h](../text/generic-text-mappings-in-tchar-h.md).
12
+
- For flexibility, use run-time macros such as `_tcschr` and `_tcscpy` when possible. For more information, see [Generic-Text Mappings in tchar.h](../text/generic-text-mappings-in-tchar-h.md).
13
13
14
14
- Use the C run-time `_getmbcp` function to get information about the current code page.
To simplify the transporting of code for international use, the Microsoft run-time library provides Microsoft-specific generic-text mappings for many data types, routines, and other objects. You can use these mappings, which are defined in Tchar.h, to write generic code that can be compiled for single-byte, multibyte, or Unicode character sets, depending on a manifest constant that you define by using a `#define` statement. Generic-text mappings are Microsoft extensions that are not ANSI compatible.
10
+
To simplify the transporting of code for international use, the Microsoft run-time library provides Microsoft-specific generic-text mappings for many data types, routines, and other objects. You can use these mappings, which are defined in tchar.h, to write generic code that can be compiled for single-byte, multibyte, or Unicode character sets, depending on a manifest constant that you define by using a `#define` statement. Generic-text mappings are Microsoft extensions that are not ANSI compatible.
11
11
12
-
By using the Tchar.h, you can build single-byte, Multibyte Character Set (MBCS), and Unicode applications from the same sources. Tchar.h defines macros (which have the prefix `_tcs`) that, with the correct preprocessor definitions, map to `str`, `_mbs`, or `wcs` functions, as appropriate. To build MBCS, define the symbol `_MBCS`. To build Unicode, define the symbol `_UNICODE`. To build a single-byte application, define neither (the default). By default, `_MBCS` is defined for MFC applications.
12
+
By using the tchar.h, you can build single-byte, Multibyte Character Set (MBCS), and Unicode applications from the same sources. tchar.h defines macros (which have the prefix `_tcs`) that, with the correct preprocessor definitions, map to `str`, `_mbs`, or `wcs` functions, as appropriate. To build MBCS, define the symbol `_MBCS`. To build Unicode, define the symbol `_UNICODE`. To build a single-byte application, define neither (the default). By default, `_MBCS` is defined for MFC applications.
13
13
14
-
The `_TCHAR` data type is defined conditionally in Tchar.h. If the symbol `_UNICODE` is defined for your build, `_TCHAR` is defined as **wchar_t**; otherwise, for single-byte and MBCS builds, it is defined as **char**. (**wchar_t**, the basic Unicode wide-character data type, is the 16-bit counterpart to an 8-bit signed **char**.) For international applications, use the `_tcs` family of functions, which operate in `_TCHAR` units, not bytes. For example, `_tcsncpy` copies `n``_TCHARs`, not `n` bytes.
14
+
The `_TCHAR` data type is defined conditionally in tchar.h. If the symbol `_UNICODE` is defined for your build, `_TCHAR` is defined as **wchar_t**; otherwise, for single-byte and MBCS builds, it is defined as **char**. (**wchar_t**, the basic Unicode wide-character data type, is the 16-bit counterpart to an 8-bit signed **char**.) For international applications, use the `_tcs` family of functions, which operate in `_TCHAR` units, not bytes. For example, `_tcsncpy` copies `n``_TCHARs`, not `n` bytes.
15
15
16
16
Because some Single Byte Character Set (SBCS) string-handling functions take (signed) `char*` parameters, a type mismatch compiler warning results when `_MBCS` is defined. There are three ways to avoid this warning:
17
17
18
-
1. Use the type-safe inline function thunks in Tchar.h. This is the default behavior.
18
+
1. Use the type-safe inline function thunks in tchar.h. This is the default behavior.
19
19
20
-
1. Use the direct macros in Tchar.h by defining `_MB_MAP_DIRECT` on the command line. If you do this, you must manually match types. This is the fastest method, but is not type-safe.
20
+
1. Use the direct macros in tchar.h by defining `_MB_MAP_DIRECT` on the command line. If you do this, you must manually match types. This is the fastest method, but is not type-safe.
21
21
22
-
1. Use the type-safe statically linked library function thunks in Tchar.h. To do so, define the constant `_NO_INLINING` on the command line. This is the slowest method, but the most type-safe.
22
+
1. Use the type-safe statically linked library function thunks in tchar.h. To do so, define the constant `_NO_INLINING` on the command line. This is the slowest method, but the most type-safe.
23
23
24
24
### Preprocessor Directives for Generic-Text Mappings
25
25
@@ -29,7 +29,7 @@ Because some Single Byte Character Set (SBCS) string-handling functions take (si
29
29
|`_MBCS`|Multibyte-character|`_tcsrev` maps to `_mbsrev`|
30
30
|None (the default has neither `_UNICODE` nor `_MBCS` defined)|SBCS (ASCII)|`_tcsrev` maps to `strrev`|
31
31
32
-
For example, the generic-text function `_tcsrev`, which is defined in Tchar.h, maps to `_mbsrev` if you defined `_MBCS` in your program, or to `_wcsrev` if you defined `_UNICODE`. Otherwise, `_tcsrev` maps to `strrev`. Other data type mappings are provided in Tchar.h for programming convenience, but `_TCHAR` is the most useful.
32
+
For example, the generic-text function `_tcsrev`, which is defined in tchar.h, maps to `_mbsrev` if you defined `_MBCS` in your program, or to `_wcsrev` if you defined `_UNICODE`. Otherwise, `_tcsrev` maps to `strrev`. Other data type mappings are provided in tchar.h for programming convenience, but `_TCHAR` is the most useful.
33
33
34
34
### Generic-Text Data Type Mappings
35
35
@@ -80,4 +80,4 @@ Therefore, you can write, maintain, and compile a single-source code file to run
80
80
## See Also
81
81
82
82
[Text and Strings](../text/text-and-strings-in-visual-cpp.md)<br/>
83
-
[Using TCHAR.H Data Types with _MBCS Code](../text/using-tchar-h-data-types-with-mbcs-code.md)
83
+
[Using TCHAR.H Data Types with _MBCS Code](../text/using-tchar-h-data-types-with-mbcs-code.md)
Copy file name to clipboardExpand all lines: docs/text/international-enabling.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Most traditional C and C++ code makes assumptions about character and string man
16
16
17
17
- Use the same portable run-time functions that make MFC portable under either environment.
18
18
19
-
- Make literal strings and characters portable under either environment, using the `_T` macro. For more information, see [Generic-Text Mappings in Tchar.h](../text/generic-text-mappings-in-tchar-h.md).
19
+
- Make literal strings and characters portable under either environment, using the `_T` macro. For more information, see [Generic-Text Mappings in tchar.h](../text/generic-text-mappings-in-tchar-h.md).
20
20
21
21
- Take precautions when parsing strings under MBCS. These precautions are not needed under Unicode. For more information, see [MBCS Programming Tips](../text/mbcs-programming-tips.md).
22
22
@@ -30,4 +30,4 @@ Most traditional C and C++ code makes assumptions about character and string man
30
30
## See Also
31
31
32
32
[Unicode and MBCS](../text/unicode-and-mbcs.md)<br/>
Copy file name to clipboardExpand all lines: docs/text/internationalization-strategies.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Depending on your target operating systems and markets, you have several interna
16
16
17
17
You use MBCS-specific functionality. Strings can contain single-byte characters, double-byte characters, or both. The C run-time library provides functions, macros, and data types for MBCS-only programming. MFC is fully MBCS-enabled.
18
18
19
-
- The source code for your application is written for complete portability — by recompiling with the symbol `_UNICODE` or the symbol `_MBCS` defined, you can produce versions that use either. For more information, see [Generic-Text Mappings in Tchar.h](../text/generic-text-mappings-in-tchar-h.md).
19
+
- The source code for your application is written for complete portability — by recompiling with the symbol `_UNICODE` or the symbol `_MBCS` defined, you can produce versions that use either. For more information, see [Generic-Text Mappings in tchar.h](../text/generic-text-mappings-in-tchar-h.md).
20
20
21
21
You use fully portable C run-time functions, macros, and data types. MFC's flexibility supports any of these strategies.
22
22
@@ -25,4 +25,4 @@ The remainder of these topics focus on writing completely portable code that you
25
25
## See Also
26
26
27
27
[Unicode and MBCS](../text/unicode-and-mbcs.md)<br/>
28
-
[Locales and Code Pages](../text/locales-and-code-pages.md)
28
+
[Locales and Code Pages](../text/locales-and-code-pages.md)
Copy file name to clipboardExpand all lines: docs/text/support-for-multibyte-character-sets-mbcss.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ The C run-time library and MFC support single-byte, MBCS, and Unicode programmin
36
36
37
37
### MBCS/Unicode portability
38
38
39
-
Using the Tchar.h header file, you can build single-byte, MBCS, and Unicode applications from the same sources. Tchar.h defines macros prefixed with *_tcs* , which map to `str`, `_mbs`, or `wcs` functions, as appropriate. To build MBCS, define the symbol `_MBCS`. To build Unicode, define the symbol `_UNICODE`. By default, `_UNICODE` is defined for MFC applications. For more information, see [Generic-Text Mappings in Tchar.h](../text/generic-text-mappings-in-tchar-h.md).
39
+
Using the tchar.h header file, you can build single-byte, MBCS, and Unicode applications from the same sources. Tchar.h defines macros prefixed with *_tcs* , which map to `str`, `_mbs`, or `wcs` functions, as appropriate. To build MBCS, define the symbol `_MBCS`. To build Unicode, define the symbol `_UNICODE`. By default, `_UNICODE` is defined for MFC applications. For more information, see [Generic-Text Mappings in tchar.h](../text/generic-text-mappings-in-tchar-h.md).
40
40
41
41
> [!NOTE]
42
42
> Behavior is undefined if you define both `_UNICODE` and `_MBCS`.
Copy file name to clipboardExpand all lines: docs/text/unicode-programming-summary.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,11 @@ To take advantage of the MFC and C run-time support for Unicode, you need to:
14
14
15
15
- Specify entry point.
16
16
17
-
On the **Output** page of the **Linker** folder in the project's [Property Pages](../ide/property-pages-visual-cpp.md) dialog box, set the **Entry Point** symbol to `wWinMainCRTStartup`.
17
+
On the **Advanced** page of the **Linker** folder in the project's [Property Pages](../ide/property-pages-visual-cpp.md) dialog box, set the **Entry Point** symbol to `wWinMainCRTStartup`.
18
18
19
19
- Use portable run-time functions and types.
20
20
21
-
Use the proper C run-time functions for Unicode string handling. You can use the `wcs` family of functions, but you might prefer the fully portable (internationally enabled) `_TCHAR` macros. These macros are all prefixed with `_tcs`; they substitute, one for one, for the `str` family of functions. These functions are described in detail in the [Internationalization](../c-runtime-library/internationalization.md) section of the *Run-Time Library Reference*. For more information, see [Generic-Text Mappings in Tchar.h](../text/generic-text-mappings-in-tchar-h.md).
21
+
Use the proper C run-time functions for Unicode string handling. You can use the `wcs` family of functions, but you might prefer the fully portable (internationally enabled) `_TCHAR` macros. These macros are all prefixed with `_tcs`; they substitute, one for one, for the `str` family of functions. These functions are described in detail in the [Internationalization](../c-runtime-library/internationalization.md) section of the *Run-Time Library Reference*. For more information, see [Generic-Text Mappings in tchar.h](../text/generic-text-mappings-in-tchar-h.md).
22
22
23
23
Use `_TCHAR` and the related portable data types described in [Support for Unicode](../text/support-for-unicode.md).
24
24
@@ -79,10 +79,10 @@ To summarize, MFC and the run-time library provide the following support for Uni
79
79
80
80
- The run-time library supplies Unicode versions of all string-handling functions. (The run-time library also supplies portable versions suitable for Unicode or for MBCS. These are the `_tcs` macros.)
81
81
82
-
-Tchar.h supplies portable data types and the `_T` macro for translating literal strings and characters. For more information, see [Generic-Text Mappings in Tchar.h](../text/generic-text-mappings-in-tchar-h.md).
82
+
-tchar.h supplies portable data types and the `_T` macro for translating literal strings and characters. For more information, see [Generic-Text Mappings in tchar.h](../text/generic-text-mappings-in-tchar-h.md).
83
83
84
84
- The run-time library provides a wide-character version of `main`. Use `wmain` to make your application Unicode-aware.
85
85
86
86
## See Also
87
87
88
-
[Support for Unicode](../text/support-for-unicode.md)
88
+
[Support for Unicode](../text/support-for-unicode.md)
Copy file name to clipboardExpand all lines: docs/text/using-tchar-h-data-types-with-mbcs-code.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ When the manifest constant `_MBCS` is defined, a given generic-text routine maps
15
15
16
16
Following are three solutions for preventing this type conflict (and the C compiler warnings or C++ compiler errors that would result):
17
17
18
-
- Use the default behavior. Tchar.h provides generic-text routine prototypes for routines in the run-time libraries, as in the following example.
18
+
- Use the default behavior. tchar.h provides generic-text routine prototypes for routines in the run-time libraries, as in the following example.
19
19
20
20
```cpp
21
21
char * _tcsrev(char *);
@@ -29,7 +29,7 @@ Following are three solutions for preventing this type conflict (and the C compi
29
29
#define_USE_INLINING
30
30
```
31
31
32
-
This method causes an inline function thunk, provided in Tchar.h, to map the generic-text routine directly to the appropriate MBCS routine. The following code excerpt from Tchar.h provides an example of how this is done.
32
+
This method causes an inline function thunk, provided in tchar.h, to map the generic-text routine directly to the appropriate MBCS routine. The following code excerpt from tchar.h provides an example of how this is done.
33
33
34
34
```cpp
35
35
__inline char *_tcsrev(char *_s1)
@@ -44,7 +44,7 @@ Following are three solutions for preventing this type conflict (and the C compi
44
44
#define_MB_MAP_DIRECT
45
45
```
46
46
47
-
This approach provides a fast alternative if you donot want to use the default behavior or cannot use inlining. It causes the generic-text routine to be mapped by a macro directly to the MBCS version of the routine, as in the following example from Tchar.h.
47
+
This approach provides a fast alternative if you donot want to use the default behavior or cannot use inlining. It causes the generic-text routine to be mapped by a macro directly to the MBCS version of the routine, as in the following example from tchar.h.
48
48
49
49
```cpp
50
50
#define_tcschr_mbschr
@@ -54,4 +54,4 @@ Following are three solutions for preventing this type conflict (and the C compi
54
54
55
55
## See Also
56
56
57
-
[Generic-Text Mappings in Tchar.h](../text/generic-text-mappings-in-tchar-h.md)
57
+
[Generic-Text Mappings in tchar.h](../text/generic-text-mappings-in-tchar-h.md)
0 commit comments