Skip to content

Commit bc3ef0a

Browse files
author
mtx48109
committed
preprocessor formatting review pr4
1 parent 7c42d2c commit bc3ef0a

25 files changed

+317
-280
lines changed

docs/preprocessor/predefined-macros.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Visual C++ supports the required predefined preprocessor macros specified by the
2222

2323
The compiler supports this predefined identifier specified by ISO C99 and ISO C++11.
2424

25-
- **__func__** The unqualified and unadorned name of the enclosing function as a function-local `static const` array of `char`.
25+
- **__func__** The unqualified and unadorned name of the enclosing function as a function-local **static const** array of **char**.
2626

2727
```cpp
2828
void example(){
@@ -60,7 +60,7 @@ Microsoft Visual C++ supports these additional predefined macros.
6060

6161
- **__AVX2__** Defined as 1 when the [/arch:AVX2](../build/reference/arch-x86.md) compiler option is set and the compiler target is x86 or x64. Otherwise, undefined.
6262

63-
- **_CHAR_UNSIGNED** Defined as 1 if the default `char` type is unsigned. This is set when the [/J (Default char Type Is unsigned)](../build/reference/j-default-char-type-is-unsigned.md) compiler option is set. Otherwise, undefined.
63+
- **_CHAR_UNSIGNED** Defined as 1 if the default **char** type is unsigned. This is set when the [/J (Default char Type Is unsigned)](../build/reference/j-default-char-type-is-unsigned.md) compiler option is set. Otherwise, undefined.
6464

6565
- **__CLR_VER** Defined as an integer literal that represents the version of the common language runtime used when the application was compiled. The value is encoded in the form `Mmmbbbbb`, where `M` is the major version of the runtime, `mm` is the minor version of the runtime, and `bbbbb` is the build number. **__CLR_VER** is defined if the [/clr](../build/reference/clr-common-language-runtime-compilation.md) compiler option is set. Otherwise, undefined.
6666

@@ -178,9 +178,9 @@ Microsoft Visual C++ supports these additional predefined macros.
178178
179179
- **_M_ARM_FP** Defined as an integer literal value that indicates which [/arch](../build/reference/arch-arm.md) compiler option was set, if the compilation target is an ARM processor. Otherwise, undefined.
180180
181-
- In the range 30-39 if no **/arch** ARM option was specified, indicating the default architecture for ARM was set (`VFPv3`).
181+
- In the range 30-39 if no `/arch` ARM option was specified, indicating the default architecture for ARM was set (`VFPv3`).
182182
183-
- In the range 40-49 if **/arch:VFPv4** was set.
183+
- In the range 40-49 if `/arch:VFPv4` was set.
184184
185185
- See [/arch (ARM)](../build/reference/arch-arm.md) for more information.
186186
@@ -204,11 +204,11 @@ Microsoft Visual C++ supports these additional predefined macros.
204204
205205
- **_M_IX86_FP** Defined as an integer literal value that indicates the [/arch](../build/reference/arch-arm.md) compiler option that was set, or the default. This macro is always defined when the compilation target is an x86 processor. Otherwise, undefined. When defined, the value is:
206206
207-
- 0 if the **/arch:IA32** compiler option was set.
207+
- 0 if the `/arch:IA32` compiler option was set.
208208
209-
- 1 if the **/arch:SSE** compiler option was set.
209+
- 1 if the `/arch:SSE` compiler option was set.
210210
211-
- 2 if the **/arch:SSE2**, **/arch:AVX** or **/arch:AVX2** compiler option was set. This value is the default if an **/arch** compiler option was not specified. When **/arch:AVX** is specified, the macro **__AVX__** is also defined. When **/arch:AVX2** is specified, both **__AVX__** and **__AVX2__** are also defined.
211+
- 2 if the `/arch:SSE2`, `/arch:AVX` or `/arch:AVX2` compiler option was set. This value is the default if an `/arch` compiler option was not specified. When `/arch:AVX` is specified, the macro **__AVX__** is also defined. When `/arch:AVX2` is specified, both **__AVX__** and **__AVX2__** are also defined.
212212
213213
- See [/arch (x86)](../build/reference/arch-x86.md) for more information.
214214
@@ -220,9 +220,9 @@ Microsoft Visual C++ supports these additional predefined macros.
220220
221221
- **_MSC_EXTENSIONS** Defined as 1 if the [/Ze (Enable Language Extensions)](../build/reference/za-ze-disable-language-extensions.md) compiler option is set, which is the default. Otherwise, undefined.
222222
223-
- **_MSC_FULL_VER** Defined as an integer literal that encodes the major, minor, and build number elements of the compiler's version number. The major number is the first element of the period-delimited version number, the minor number is the second element, and the build number is the third element. For example, if the version number of the Visual C++ compiler is 15.00.20706.01, the **_MSC_FULL_VER** macro evaluates to 150020706. Enter **cl /?** at the command line to view the compiler's version number. This macro is always defined.
223+
- **_MSC_FULL_VER** Defined as an integer literal that encodes the major, minor, and build number elements of the compiler's version number. The major number is the first element of the period-delimited version number, the minor number is the second element, and the build number is the third element. For example, if the version number of the Visual C++ compiler is 15.00.20706.01, the **_MSC_FULL_VER** macro evaluates to 150020706. Enter `cl /?` at the command line to view the compiler's version number. This macro is always defined.
224224
225-
- **_MSC_VER** Defined as an integer literal that encodes the major and minor number elements of the compiler's version number. The major number is the first element of the period-delimited version number and the minor number is the second element. For example, if the version number of the Visual C++ compiler is 17.00.51106.1, the **_MSC_VER** macro evaluates to 1700. Enter **cl /?** at the command line to view the compiler's version number. This macro is always defined.
225+
- **_MSC_VER** Defined as an integer literal that encodes the major and minor number elements of the compiler's version number. The major number is the first element of the period-delimited version number and the minor number is the second element. For example, if the version number of the Visual C++ compiler is 17.00.51106.1, the **_MSC_VER** macro evaluates to 1700. Enter `cl /?` at the command line to view the compiler's version number. This macro is always defined.
226226
227227
|Visual Studio version|_MSC_VER|
228228
|-|-|
@@ -280,7 +280,7 @@ Microsoft Visual C++ supports these additional predefined macros.
280280
281281
- **_VC_NODEFAULTLIB** Defined as 1 when the [/Zl (Omit Default Library Name)](../build/reference/zl-omit-default-library-name.md) compiler option is set. Otherwise, undefined.
282282
283-
- **_WCHAR_T_DEFINED** Defined as 1 when the default [/Zc:wchar_t](../build/reference/zc-wchar-t-wchar-t-is-native-type.md) compiler option is set. The **_WCHAR_T_DEFINED** macro is defined but has no value if the **/Zc:wchar_t-** compiler option is set, and `wchar_t` is defined in a system header file included in your project. Otherwise, undefined.
283+
- **_WCHAR_T_DEFINED** Defined as 1 when the default [/Zc:wchar_t](../build/reference/zc-wchar-t-wchar-t-is-native-type.md) compiler option is set. The **_WCHAR_T_DEFINED** macro is defined but has no value if the `/Zc:wchar_t-` compiler option is set, and **wchar_t** is defined in a system header file included in your project. Otherwise, undefined.
284284
285285
- **_WIN32** Defined as 1 when the compilation target is 32-bit ARM, 64-bit ARM, x86, or x64. Otherwise, undefined.
286286
@@ -298,4 +298,4 @@ Microsoft Visual C++ supports these additional predefined macros.
298298
299299
[Macros (C/C++)](../preprocessor/macros-c-cpp.md)
300300
[Preprocessor Operators](../preprocessor/preprocessor-operators.md)
301-
[Preprocessor Directives](../preprocessor/preprocessor-directives.md)
301+
[Preprocessor Directives](../preprocessor/preprocessor-directives.md)

docs/preprocessor/preprocessor-directives.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ ms.workload: ["cplusplus"]
1313
---
1414
# Preprocessor Directives
1515

16-
Preprocessor directives, such as `#define` and **#ifdef**, are typically used to make source programs easy to change and easy to compile in different execution environments. Directives in the source file tell the preprocessor to perform specific actions. For example, the preprocessor can replace tokens in the text, insert the contents of other files into the source file, or suppress compilation of part of the file by removing sections of text. Preprocessor lines are recognized and carried out before macro expansion. Therefore, if a macro expands into something that looks like a preprocessor command, that command is not recognized by the preprocessor.
16+
Preprocessor directives, such as `#define` and `#ifdef`, are typically used to make source programs easy to change and easy to compile in different execution environments. Directives in the source file tell the preprocessor to perform specific actions. For example, the preprocessor can replace tokens in the text, insert the contents of other files into the source file, or suppress compilation of part of the file by removing sections of text. Preprocessor lines are recognized and carried out before macro expansion. Therefore, if a macro expands into something that looks like a preprocessor command, that command is not recognized by the preprocessor.
1717

18-
Preprocessor statements use the same character set as source file statements, with the exception that escape sequences are not supported. The character set used in preprocessor statements is the same as the [execution character set](http://msdn.microsoft.com/en-us/a7901c61-524d-47c6-beb6-d9dacc2e72ed). The preprocessor also recognizes negative character values.
18+
Preprocessor statements use the same character set as source file statements, with the exception that escape sequences are not supported. The character set used in preprocessor statements is the same as the [execution character set](http://msdn.microsoft.com/a7901c61-524d-47c6-beb6-d9dacc2e72ed). The preprocessor also recognizes negative character values.
1919

2020
The preprocessor recognizes the following directives:
2121

docs/preprocessor/preprocessor-grammar.md

+50-49
Original file line numberDiff line numberDiff line change
@@ -14,87 +14,88 @@ ms.workload: ["cplusplus"]
1414
# Preprocessor Grammar
1515
**#define** *identifier* *token-string*opt
1616

17-
*#* **define** *identifier*[**(** *identifier*opt**,** *...* **,** *identifier*opt **)**] *token-string*opt
17+
*#* **define** *identifier*[**(** *identifier*opt**,** *...* **,** *identifier*opt **)**] *token-string*opt
1818

19-
**defined(** *identifier* **)**
19+
**defined(** *identifier* **)**
2020

21-
**defined** *identifier*
21+
**defined** *identifier*
2222

23-
`#include` **"***path-spec***"**
23+
`#include` **"***path-spec***"**
2424

25-
`#include` **\<***path-spec***>**
25+
`#include` **\<***path-spec***>**
2626

27-
**#line** *digit-sequence* **"** *filename* **"**opt
27+
**#line** *digit-sequence* **"** *filename* **"**opt
2828

29-
*#* **undef** *identifier*
29+
*#* **undef** *identifier*
3030

31-
**#error** *token-string*
31+
**#error** *token-string*
3232

33-
**#pragma** *token-string*
33+
**#pragma** *token-string*
3434

35-
*conditional* :
36-
*if-part elif-parts*opt*else-part*opt*endif-line*
35+
*conditional* :
36+
*if-part elif-parts*opt*else-part*opt*endif-line*
3737

38-
*if-part* :
39-
*if-linetext*
38+
*if-part* :
39+
*if-linetext*
4040

41-
*if-line* :
42-
**#if** *constant-expression*
41+
*if-line* :
42+
**#if** *constant-expression*
4343

44-
**#ifdef** *identifier*
44+
**#ifdef** *identifier*
4545

46-
**#ifndef** *identifier*
46+
**#ifndef** *identifier*
4747

48-
*elif-parts* :
49-
*elif-line text*
48+
*elif-parts* :
49+
*elif-line text*
5050

51-
*elif-parts elif-line text*
51+
*elif-parts elif-line text*
5252

53-
*elif-line* :
54-
**#elif** *constant-expression*
53+
*elif-line* :
54+
**#elif** *constant-expression*
5555

56-
*else-part* :
57-
*else-linetext*
56+
*else-part* :
57+
*else-linetext*
5858

59-
*else-line* :
60-
`#else`
59+
*else-line* :
60+
`#else`
6161

62-
*endif-line* :
63-
`#endif`
62+
*endif-line* :
63+
`#endif`
6464

65-
*digit-sequence* :
66-
*digit*
65+
*digit-sequence* :
66+
*digit*
6767

68-
*digit-sequence digit*
68+
*digit-sequence digit*
6969

70-
*digit* : one of
71-
**0 1 2 3 4 5 6 7 8 9**
70+
*digit* : one of
71+
**0 1 2 3 4 5 6 7 8 9**
7272

73-
*token-string* :
74-
String of tokens
73+
*token-string* :
74+
String of tokens
7575

76-
*token* :
77-
*keyword*
76+
*token* :
77+
*keyword*
7878

79-
*identifier*
79+
*identifier*
8080

81-
*constant*
81+
*constant*
8282

83-
*operator*
83+
*operator*
8484

85-
`punctuator`
85+
`punctuator`
8686

87-
*filename* :
88-
Legal operating system filename
87+
*filename* :
88+
Legal operating system filename
8989

90-
*path-spec* :
91-
Legal file path
90+
*path-spec* :
91+
Legal file path
9292

93-
*text* :
94-
Any sequence of text
93+
*text* :
94+
Any sequence of text
9595

9696
> [!NOTE]
97-
> The following nonterminals are expanded in the [Lexical Conventions](../cpp/lexical-conventions.md) section of the *C++ Language Reference*: `constant`, `constant`-*expression*, *identifier*, *keyword*, `operator`, and `punctuator`.
97+
> The following nonterminals are expanded in the [Lexical Conventions](../cpp/lexical-conventions.md) section of the *C++ Language Reference*: `constant`, `constant`-*expression*, *identifier*, *keyword*, `operator`, and `punctuator`.
9898
9999
## See Also
100-
[Grammar Summary (C/C++)](../preprocessor/grammar-summary-c-cpp.md)
100+
101+
[Grammar Summary (C/C++)](../preprocessor/grammar-summary-c-cpp.md)

docs/preprocessor/preprocessor-operators.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: "corob"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# Preprocessor Operators
15-
Four preprocessor-specific operators are used in the context of the `#define` directive (see the following list for a summary of each). The stringizing, charizing, and token-pasting operators are discussed in the next three sections. For information on the **defined** operator, see [The #if, #elif, #else, and #endif Directives](../preprocessor/hash-if-hash-elif-hash-else-and-hash-endif-directives-c-cpp.md).
15+
Four preprocessor-specific operators are used in the context of the `#define` directive (see the following list for a summary of each). The stringizing, charizing, and token-pasting operators are discussed in the next three sections. For information on the `defined` operator, see [The #if, #elif, #else, and #endif Directives](../preprocessor/hash-if-hash-elif-hash-else-and-hash-endif-directives-c-cpp.md).
1616

1717
|Operator|Action|
1818
|--------------|------------|
@@ -22,6 +22,7 @@ Four preprocessor-specific operators are used in the context of the `#define` di
2222
|[defined operator](../preprocessor/hash-if-hash-elif-hash-else-and-hash-endif-directives-c-cpp.md)|Simplifies the writing of compound expressions in certain macro directives|
2323

2424
## See Also
25-
[Preprocessor Directives](../preprocessor/preprocessor-directives.md)
26-
[Predefined Macros](../preprocessor/predefined-macros.md)
27-
[C/C++ Preprocessor Reference](../preprocessor/c-cpp-preprocessor-reference.md)
25+
26+
[Preprocessor Directives](../preprocessor/preprocessor-directives.md)
27+
[Predefined Macros](../preprocessor/predefined-macros.md)
28+
[C/C++ Preprocessor Reference](../preprocessor/c-cpp-preprocessor-reference.md)

docs/preprocessor/preprocessor.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,29 @@ ms.workload: ["cplusplus"]
1414
# Preprocessor
1515
The preprocessor is a text processor that manipulates the text of a source file as part of the first phase of translation. The preprocessor does not parse the source text, but it does break it up into tokens for the purpose of locating macro calls. Although the compiler ordinarily invokes the preprocessor in its first pass, the preprocessor can also be invoked separately to process text without compiling.
1616

17-
The reference material on the preprocessor includes the following sections:
17+
The reference material on the preprocessor includes the following sections:
1818

19-
- [Preprocessor directives](../preprocessor/preprocessor-directives.md)
19+
- [Preprocessor directives](../preprocessor/preprocessor-directives.md)
2020

21-
- [Preprocessor operators](../preprocessor/preprocessor-operators.md)
21+
- [Preprocessor operators](../preprocessor/preprocessor-operators.md)
2222

23-
- [Predefined macros](../preprocessor/predefined-macros.md)
23+
- [Predefined macros](../preprocessor/predefined-macros.md)
2424

25-
- [Pragmas](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
25+
- [Pragmas](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
2626

27-
**Microsoft Specific**
27+
**Microsoft Specific**
2828

29-
You can obtain a listing of your source code after preprocessing by using the [/E](../build/reference/e-preprocess-to-stdout.md) or [/EP](../build/reference/ep-preprocess-to-stdout-without-hash-line-directives.md) compiler option. Both options invoke the preprocessor and output the resulting text to the standard output device, which, in most cases, is the console. The difference between the two options is that /E includes `#line` directives and /EP strips these directives out.
29+
You can obtain a listing of your source code after preprocessing by using the [/E](../build/reference/e-preprocess-to-stdout.md) or [/EP](../build/reference/ep-preprocess-to-stdout-without-hash-line-directives.md) compiler option. Both options invoke the preprocessor and output the resulting text to the standard output device, which, in most cases, is the console. The difference between the two options is that /E includes `#line` directives and /EP strips these directives out.
3030

31-
**END Microsoft Specific**
31+
**END Microsoft Specific**
3232

3333
## <a name="_predir_special_terminology"></a> Special Terminology
34-
In the preprocessor documentation, the term "argument" refers to the entity that is passed to a function. In some cases, it is modified by "actual" or "formal," which describes the argument expression specified in the function call and the argument declaration specified in the function definition, respectively.
34+
35+
In the preprocessor documentation, the term "argument" refers to the entity that is passed to a function. In some cases, it is modified by "actual" or "formal," which describes the argument expression specified in the function call and the argument declaration specified in the function definition, respectively.
3536

36-
The term "variable" refers to a simple C-type data object. The term "object" refers to both C++ objects and variables; it is an inclusive term.
37+
The term "variable" refers to a simple C-type data object. The term "object" refers to both C++ objects and variables; it is an inclusive term.
3738

3839
## See Also
39-
[C/C++ Preprocessor Reference](../preprocessor/c-cpp-preprocessor-reference.md)
40-
[Phases of Translation](../preprocessor/phases-of-translation.md)
40+
41+
[C/C++ Preprocessor Reference](../preprocessor/c-cpp-preprocessor-reference.md)
42+
[Phases of Translation](../preprocessor/phases-of-translation.md)

docs/preprocessor/push-macro.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ Saves the value of the *macro_name* macro on the top of the stack for this macro
1818
## Syntax
1919

2020
```
21-
2221
#pragma push_macro("
2322
macro_name
2423
")
25-
2624
```
2725

2826
## Remarks
29-
You can retrieve the value for *macro_name* with **pop_macro**.
27+
28+
You can retrieve the value for *macro_name* with `pop_macro`.
3029

31-
See [pop_macro](../preprocessor/pop-macro.md) for a sample.
30+
See [pop_macro](../preprocessor/pop-macro.md) for a sample.
3231

3332
## See Also
34-
[Pragma Directives and the __Pragma Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)
33+
34+
[Pragma Directives and the __Pragma Keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md)

0 commit comments

Comments
 (0)