Skip to content

Commit 31524b1

Browse files
authored
Merge pull request #1231 from msebolt/preprocessor-formatting-review-pr2
preprocessor formatting review pr2
2 parents 7b18e79 + 8fe3987 commit 31524b1

20 files changed

+306
-281
lines changed

docs/preprocessor/hash-import-attributes-cpp.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ ms.author: "corob"
1212
ms.workload: ["cplusplus"]
1313
---
1414
# #import Attributes (C++)
15-
Provides links to attributes used with the #import directive.
15+
Provides links to attributes used with the `#import` directive.
1616

17-
**Microsoft Specific**
17+
**Microsoft Specific**
1818

19-
The following attributes are available to the #import directive.
19+
The following attributes are available to the `#import` directive.
2020

2121
|Attribute|Description|
2222
|---------------|-----------------|
@@ -29,15 +29,15 @@ Provides links to attributes used with the #import directive.
2929
|[implementation_only](../preprocessor/implementation-only.md)|Suppresses the generation of the .tlh header file (the primary header file).|
3030
|[include()](../preprocessor/include-parens.md)|Disables automatic exclusion.|
3131
|[inject_statement](../preprocessor/inject-statement.md)|Inserts its argument as source text into the type-library header.|
32-
|[named_guids](../preprocessor/named-guids.md)|Tells the compiler to define and initialize GUID variables in old style, of the form **LIBID_MyLib**, **CLSID_MyCoClass**, **IID_MyInterface**, and **DIID_MyDispInterface**.|
32+
|[named_guids](../preprocessor/named-guids.md)|Tells the compiler to define and initialize GUID variables in old style, of the form `LIBID_MyLib`, `CLSID_MyCoClass`, `IID_MyInterface`, and `DIID_MyDispInterface`.|
3333
|[no_auto_exclude](../preprocessor/no-auto-exclude.md)|Disables automatic exclusion.|
3434
|[no_dual_interfaces](../preprocessor/no-dual-interfaces.md)|Changes the way the compiler generates wrapper functions for dual interface methods.|
3535
|[no_implementation](../preprocessor/no-implementation.md)|Suppresses the generation of the .tli header, which contains the implementations of the wrapper member functions.|
3636
|[no_namespace](../preprocessor/no-namespace.md)|Specifies that the namespace name is not generated by the compiler.|
3737
|[no_registry](../preprocessor/no-registry.md)|Tells the compiler not to search the registry for type libraries.|
3838
|[no_search_namespace](../preprocessor/no-search-namespace.md)|Has the same functionality as the [no_namespace](../preprocessor/no-namespace.md) attribute but is used on type libraries that you use the #import directive with the [auto_search](../preprocessor/auto-search.md) attribute.|
3939
|[no_smart_pointers](../preprocessor/no-smart-pointers.md)|Suppresses the creation of smart pointers for all interfaces in the type library.|
40-
|[raw_dispinterfaces](../preprocessor/raw-dispinterfaces.md)|Tells the compiler to generate low-level wrapper functions for dispinterface methods and properties that call **IDispatch::Invoke** and return the `HRESULT` error code.|
40+
|[raw_dispinterfaces](../preprocessor/raw-dispinterfaces.md)|Tells the compiler to generate low-level wrapper functions for dispinterface methods and properties that call `IDispatch::Invoke` and return the HRESULT error code.|
4141
|[raw_interfaces_only](../preprocessor/raw-interfaces-only.md)|Suppresses the generation of error-handling wrapper functions and [property](../cpp/property-cpp.md) declarations that use those wrapper functions.|
4242
|[raw_method_prefix](../preprocessor/raw-method-prefix.md)|Specifies a different prefix to avoid name collisions.|
4343
|[raw_native_types](../preprocessor/raw-native-types.md)|Disables the use of COM support classes in the high-level wrapper functions and forces the use of low-level data types instead.|
@@ -47,7 +47,8 @@ Provides links to attributes used with the #import directive.
4747
|[rename_search_namespace](../preprocessor/rename-search-namespace.md)|Has the same functionality as the [rename_namespace](../preprocessor/rename-namespace.md) attribute but is used on type libraries that you use the #import directive with the [auto_search](../preprocessor/auto-search.md) attribute.|
4848
|[tlbid](../preprocessor/tlbid.md)|Allows for loading libraries other than the primary type library.|
4949

50-
**END Microsoft Specific**
50+
**END Microsoft Specific**
5151

5252
## See Also
53-
[#import Directive](../preprocessor/hash-import-directive-cpp.md)
53+
54+
[#import Directive](../preprocessor/hash-import-directive-cpp.md)

docs/preprocessor/hash-import-directive-cpp.md

Lines changed: 57 additions & 52 deletions
Large diffs are not rendered by default.

docs/preprocessor/hash-include-directive-c-cpp.md

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,77 +18,78 @@ Tells the preprocessor to treat the contents of a specified file as if they appe
1818
## Syntax
1919

2020
```
21-
22-
#include "path-spec"
21+
#include "path-spec"
2322
#include <path-spec>
2423
```
2524

26-
## Remarks
27-
You can organize constant and macro definitions into include files and then use `#include` directives to add them to any source file. Include files are also useful for incorporating declarations of external variables and complex data types. The types may be defined and named only once in an include file created for that purpose.
25+
## Remarks
26+
27+
You can organize constant and macro definitions into include files and then use **#include** directives to add them to any source file. Include files are also useful for incorporating declarations of external variables and complex data types. The types may be defined and named only once in an include file created for that purpose.
2828

29-
The `path-spec` is a file name that may optionally be preceded by a directory specification. The file name must name an existing file. The syntax of the `path-spec` depends on the operating system on which the program is compiled.
29+
The `path-spec` is a file name that may optionally be preceded by a directory specification. The file name must name an existing file. The syntax of the `path-spec` depends on the operating system on which the program is compiled.
3030

31-
For information about how to reference assemblies in a C++ application that's compiled by using [/clr](../build/reference/clr-common-language-runtime-compilation.md), see [#using](../preprocessor/hash-using-directive-cpp.md).
31+
For information about how to reference assemblies in a C++ application that's compiled by using [/clr](../build/reference/clr-common-language-runtime-compilation.md), see [#using](../preprocessor/hash-using-directive-cpp.md).
3232

33-
Both syntax forms cause that directive to be replaced by the entire contents of the specified include file. The difference between the two forms is the order in which the preprocessor searches for header files when the path is incompletely specified. The following table shows the difference between the two syntax forms.
33+
Both syntax forms cause that directive to be replaced by the entire contents of the specified include file. The difference between the two forms is the order in which the preprocessor searches for header files when the path is incompletely specified. The following table shows the difference between the two syntax forms.
3434

3535
|Syntax Form|Action|
3636
|-----------------|------------|
37-
|Quoted form|The preprocessor searches for include files in this order:<br /><br /> 1) In the same directory as the file that contains the `#include` statement.<br /><br /> 2) In the directories of the currently opened include files, in the reverse order in which they were opened. The search begins in the directory of the parent include file and continues upward through the directories of any grandparent include files.<br /><br /> 3) Along the path that's specified by each /I compiler option.<br /><br /> 4)<br /><br /> Along the paths that are specified by the INCLUDE environment variable.|
38-
|Angle-bracket form|The preprocessor searches for include files in this order:<br /><br /> 1) Along the path that's specified by each /I compiler option.<br /><br /> 2) When compiling occurs on the command line, along the paths that are specified by the INCLUDE environment variable.|
37+
|Quoted form|The preprocessor searches for include files in this order:<br /><br /> 1) In the same directory as the file that contains the **#include** statement.<br /><br /> 2) In the directories of the currently opened include files, in the reverse order in which they were opened. The search begins in the directory of the parent include file and continues upward through the directories of any grandparent include files.<br /><br /> 3) Along the path that's specified by each `/I` compiler option.<br /><br /> 4)<br /><br /> Along the paths that are specified by the INCLUDE environment variable.|
38+
|Angle-bracket form|The preprocessor searches for include files in this order:<br /><br /> 1) Along the path that's specified by each `/I` compiler option.<br /><br /> 2) When compiling occurs on the command line, along the paths that are specified by the INCLUDE environment variable.|
3939

40-
The preprocessor stops searching as soon as it finds a file that has the given name. If you enclose a complete, unambiguous path specification for the include file between double quotation marks (" "), the preprocessor searches only that path specification and ignores the standard directories.
40+
The preprocessor stops searching as soon as it finds a file that has the given name. If you enclose a complete, unambiguous path specification for the include file between double quotation marks (" "), the preprocessor searches only that path specification and ignores the standard directories.
4141

42-
If the file name that's enclosed in double quotation marks is an incomplete path specification, the preprocessor first searches the "parent" file's directory. A parent file is the file that contains the `#include` directive. For example, if you include a file named `file2` in a file named `file1`, `file1` is the parent file.
42+
If the file name that's enclosed in double quotation marks is an incomplete path specification, the preprocessor first searches the "parent" file's directory. A parent file is the file that contains the **#include** directive. For example, if you include a file named `file2` in a file named `file1`, `file1` is the parent file.
4343

44-
Include files can be "nested"; that is, an `#include` directive can appear in a file that's named by another `#include` directive. For example, `file2` could include `file3`. In this case, `file1` would still be the parent of `file2`, but it would be the "grandparent" of `file3`.
44+
Include files can be "nested"; that is, an **#include** directive can appear in a file that's named by another **#include** directive. For example, `file2` could include `file3`. In this case, `file1` would still be the parent of `file2`, but it would be the "grandparent" of `file3`.
4545

46-
When include files are nested and when compiling occurs on the command line, directory searching begins with the directories of the parent file and then proceeds through the directories of any grandparent files. That is, searching begins relative to the directory that contains the source that's currently being processed. If the file is not found, the search moves to directories that are specified by the /I compiler option. Finally, the directories that are specified by the INCLUDE environment variable are searched.
46+
When include files are nested and when compiling occurs on the command line, directory searching begins with the directories of the parent file and then proceeds through the directories of any grandparent files. That is, searching begins relative to the directory that contains the source that's currently being processed. If the file is not found, the search moves to directories that are specified by the `/I` compiler option. Finally, the directories that are specified by the INCLUDE environment variable are searched.
4747

48-
From the development environment, the INCLUDE environment variable is ignored. For information about how to set the directories that are searched for include files—this also applies to the LIB environment variable—see [VC++ Directories Property Page](../ide/vcpp-directories-property-page.md).
48+
From the development environment, the INCLUDE environment variable is ignored. For information about how to set the directories that are searched for include files—this also applies to the LIB environment variable—see [VC++ Directories Property Page](../ide/vcpp-directories-property-page.md).
4949

50-
This example shows file inclusion by using angle brackets:
50+
This example shows file inclusion by using angle brackets:
5151

5252
```
5353
#include <stdio.h>
5454
```
5555

56-
This example adds the contents of the file named STDIO.H to the source program. The angle brackets cause the preprocessor to search the directories that are specified by the INCLUDE environment variable for STDIO.H, after it searches directories that are specified by the /I compiler option.
56+
This example adds the contents of the file named STDIO.H to the source program. The angle brackets cause the preprocessor to search the directories that are specified by the INCLUDE environment variable for STDIO.H, after it searches directories that are specified by the `/I` compiler option.
5757

58-
The next example shows file inclusion by using the quoted form:
58+
The next example shows file inclusion by using the quoted form:
5959

6060
```
6161
#include "defs.h"
6262
```
6363

64-
This example adds the contents of the file that's specified by DEFS.H to the source program. The quotation marks mean that the preprocessor first searches the directory that contains the parent source file.
64+
This example adds the contents of the file that's specified by DEFS.H to the source program. The quotation marks mean that the preprocessor first searches the directory that contains the parent source file.
6565

66-
Nesting of include files can continue up to 10 levels. When the nested `#include` is processed, the preprocessor continues to insert the enclosing include file into the original source file.
66+
Nesting of include files can continue up to 10 levels. When the nested **#include** is processed, the preprocessor continues to insert the enclosing include file into the original source file.
6767

68-
**Microsoft Specific**
68+
**Microsoft Specific**
6969

70-
To locate includable source files, the preprocessor first searches the directories that are specified by the /I compiler option. If the /I option is not present or fails, the preprocessor uses the INCLUDE environment variable to find any include files within angle brackets. The INCLUDE environment variable and /I compiler option can contain multiple paths, separated by semicolons (;). If more than one directory appears as part of the /I option or within the INCLUDE environment variable, the preprocessor searches them in the order in which they appear.
70+
To locate includable source files, the preprocessor first searches the directories that are specified by the `/I` compiler option. If the `/I` option is not present or fails, the preprocessor uses the INCLUDE environment variable to find any include files within angle brackets. The INCLUDE environment variable and `/I` compiler option can contain multiple paths, separated by semicolons (;). If more than one directory appears as part of the `/I` option or within the INCLUDE environment variable, the preprocessor searches them in the order in which they appear.
7171

72-
For example, the command
72+
For example, the command
7373

7474
```
7575
CL /ID:\MSVC\INCLUDE MYPROG.C
7676
```
7777

78-
causes the preprocessor to search the directory D:\MSVC\INCLUDE\ for include files such as STDIO.H. The commands
78+
causes the preprocessor to search the directory D:\MSVC\INCLUDE\ for include files such as STDIO.H. The commands
7979

8080
```
8181
SET INCLUDE=D:\MSVC\INCLUDE
8282
CL MYPROG.C
8383
```
8484

85-
have the same effect. If both sets of searches fail, a fatal compiler error is generated.
85+
have the same effect. If both sets of searches fail, a fatal compiler error is generated.
8686

87-
If the file name is fully specified for an include file that has a path that includes a colon (for example, F:\MSVC\SPECIAL\INCL\TEST.H), the preprocessor follows the path.
87+
If the file name is fully specified for an include file that has a path that includes a colon (for example, F:\MSVC\SPECIAL\INCL\TEST.H), the preprocessor follows the path.
8888

89-
For include files that are specified as `#include` "`path-spec`", directory searching begins with the directory of the parent file and then proceeds through the directories of any grandparent files. That is, searching begins relative to the directory that contains the source file that contains the `#include` directive that's being processed. If there is no grandparent file and the file has not been found, the search continues as if the file name were enclosed in angle brackets.
89+
For include files that are specified as `#include` "`path-spec`", directory searching begins with the directory of the parent file and then proceeds through the directories of any grandparent files. That is, searching begins relative to the directory that contains the source file that contains the **#include** directive that's being processed. If there is no grandparent file and the file has not been found, the search continues as if the file name were enclosed in angle brackets.
9090

91-
**END Microsoft Specific**
91+
**END Microsoft Specific**
9292

9393
## See Also
94-
[Preprocessor Directives](../preprocessor/preprocessor-directives.md)
94+
95+
[Preprocessor Directives](../preprocessor/preprocessor-directives.md)

0 commit comments

Comments
 (0)