Skip to content

Commit f81b692

Browse files
authored
Merge pull request #282 from Microsoft/master
merge to live
2 parents 3d9cec7 + 78badac commit f81b692

File tree

97 files changed

+577
-803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+577
-803
lines changed

docs/build/calling-dll-functions-from-visual-basic-applications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ EXPORTS
7878
INITCODE=_InitCode@0
7979
```
8080

81-
For DLLs to be called by programs written in Visual Basic, the alias technique shown in this topic is needed in the .def file. If the alias is done in the Visual Basic program, use of aliasing in the .def file is not necessary. It can be done in the Visual Basic program by adding an alias clause to the [Declare](/dotnet/articles/visual-basic/language-reference/statements/declare-statement) statement.
81+
For DLLs to be called by programs written in Visual Basic, the alias technique shown in this topic is needed in the .def file. If the alias is done in the Visual Basic program, use of aliasing in the .def file is not necessary. It can be done in the Visual Basic program by adding an alias clause to the [Declare](/dotnet/visual-basic/language-reference/statements/declare-statement) statement.
8282

8383
## What do you want to know more about?
8484

docs/build/reference/TOC.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,6 @@
145145
#### [-Zs (Syntax Check Only)](zs-syntax-check-only.md)
146146
#### [-ZW (Windows Runtime Compilation)](zw-windows-runtime-compilation.md)
147147
## [Creating Precompiled Header Files](creating-precompiled-header-files.md)
148-
### [When to Precompile Source Code](when-to-precompile-source-code.md)
149-
### [Two Choices for Precompiling Code](two-choices-for-precompiling-code.md)
150-
### [Precompiled Header Consistency Rules](precompiled-header-consistency-rules.md)
151-
#### [Consistency Rules for Per-File Use of Precompiled Headers](consistency-rules-for-per-file-use-of-precompiled-headers.md)
152-
#### [Consistency Rules for -Yc and -Yu](consistency-rules-for-yc-and-yu.md)
153-
### [Using Precompiled Headers in a Project](using-precompiled-headers-in-a-project.md)
154-
#### [PCH Files in the Build Process](pch-files-in-the-build-process.md)
155-
#### [Sample Makefile for PCH](sample-makefile-for-pch.md)
156-
#### [Example Code for PCH](example-code-for-pch.md)
157148
## [Unicode Support in the Compiler and Linker](unicode-support-in-the-compiler-and-linker.md)
158149
# [Linking](linking.md)
159150
## [Setting Linker Options](setting-linker-options.md)

docs/build/reference/assemblylinkresource-link-to-dotnet-framework-resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ translation.priority.ht:
5555

5656
/ASSEMBLYLINKRESOURCE requires that the compilation include [/clr](../../build/reference/clr-common-language-runtime-compilation.md); [/LN](../../build/reference/ln-create-msil-module.md) or [/NOASSEMBLY](../../build/reference/noassembly-create-a-msil-module.md) is not allowed with /ASSEMBLYLINKRESOURCE.
5757

58-
If *filename* is a .NET Framework resource file created, for example, by [Resgen.exe](http://msdn.microsoft.com/Library/8ef159de-b660-4bec-9213-c3fbc4d1c6f4) or in the development environment, it can be accessed with members in the **System.Resources** namespace. For more information, see [System.Resources.ResourceManager](https://msdn.microsoft.com/en-us/library/system.resources.resourcemanager.aspx). For all other resources, use the **GetManifestResource**\* methods in the **System.Reflection.Assembly** class to access the resource at run time.
58+
If *filename* is a .NET Framework resource file created, for example, by [Resgen.exe](/dotnet/framework/tools/resgen-exe-resource-file-generator) or in the development environment, it can be accessed with members in the **System.Resources** namespace. For more information, see [System.Resources.ResourceManager](https://msdn.microsoft.com/en-us/library/system.resources.resourcemanager.aspx). For all other resources, use the **GetManifestResource**\* methods in the **System.Reflection.Assembly** class to access the resource at run time.
5959

6060
*filename* can be any file format. For example, you may want to make a native DLL part of the assembly, so it can be installed into the Global Assembly Cache and accessed from managed code in the assembly.
6161

docs/build/reference/assemblyresource-embed-a-managed-resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ translation.priority.ht:
5858

5959
Resources are public in the assembly when created with the linker. The linker does not allow you to rename the resource in the assembly.
6060

61-
If *filename* is a .NET Framework resource (.resources) file created, for example, by the [Resource File Generator (Resgen.exe)](http://msdn.microsoft.com/Library/8ef159de-b660-4bec-9213-c3fbc4d1c6f4) or in the development environment, it can be accessed with members in the **System.Resources** namespace (see [System.Resources.ResourceManager](https://msdn.microsoft.com/en-us/library/system.resources.resourcemanager.aspx) for more information). For all other resources, use the **GetManifestResource**\* methods in **System.Reflection.Assembly** class to access the resource at run time.
61+
If *filename* is a .NET Framework resource (.resources) file created, for example, by the [Resource File Generator (Resgen.exe)](/dotnet/framework/tools/resgen-exe-resource-file-generator) or in the development environment, it can be accessed with members in the **System.Resources** namespace (see [System.Resources.ResourceManager](https://msdn.microsoft.com/en-us/library/system.resources.resourcemanager.aspx) for more information). For all other resources, use the **GetManifestResource**\* methods in **System.Reflection.Assembly** class to access the resource at run time.
6262

6363
Other linker options that affect assembly generation are:
6464

docs/build/reference/clr-common-language-runtime-compilation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Enables applications and components to use features from the common language run
7272
/clr:pure is deprecated. A future version of the compiler may not support this option. We recommend that you port code that must be pure MSIL to C#.
7373

7474
**/clr:safe**
75-
Produces an MSIL-only (no native executable code), verifiable output file. **/clr:safe** enables verification diagnostics ([PEVerify Tool (Peverify.exe)](http://msdn.microsoft.com/Library/f4f46f9e-8d08-4e66-a94b-0c69c9b0bbfa)).
75+
Produces an MSIL-only (no native executable code), verifiable output file. **/clr:safe** enables verification diagnostics ([PEVerify Tool (Peverify.exe)](/dotnet/framework/tools/peverify-exe-peverify-tool)).
7676

7777

7878
/clr:safe is deprecated. A future version of the compiler may not support this option. We recommend that you port code that must be pure, verifiable MSIL to C#.
@@ -121,7 +121,7 @@ Enables applications and components to use features from the common language run
121121

122122
The global variables in a native object file are initialized first (during DllMain if the executable is a DLL), and then the global variables in the managed section are initialized (before any managed code is run). `#pragma`[init_seg](../../preprocessor/init-seg.md) only affects the order of initialization in the managed and unmanaged categories.
123123

124-
Compiling by using **/clr:safe** is analogous to compiling by using [/platform:anycpu](/dotnet/articles/csharp/language-reference/compiler-options/platform-compiler-option) in languages such as C#.
124+
Compiling by using **/clr:safe** is analogous to compiling by using [/platform:anycpu](/dotnet/csharp/language-reference/compiler-options/platform-compiler-option) in languages such as C#.
125125

126126
## Safe and Pure Images
127127
A pure image uses a CLR version of the C run-time (CRT) library. However, the CRT is not verifiable, so you cannot use the CRT when you compile by using **/clr:safe**. For more information, see [CRT Library Features](../../c-runtime-library/crt-library-features.md).
Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,3 @@
11
---
2-
title: "Consistency Rules for Per-File Use of Precompiled Headers | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "11/04/2016"
5-
ms.reviewer: ""
6-
ms.suite: ""
7-
ms.technology:
8-
- "cpp-tools"
9-
ms.tgt_pltfrm: ""
10-
ms.topic: "article"
11-
dev_langs:
12-
- "C++"
13-
helpviewer_keywords:
14-
- "precompiled header files, consistency rules"
15-
- "PCH files, consistency rules"
16-
- ".pch files, consistency rules"
17-
ms.assetid: afd49365-48bc-41f4-b700-fe8297b944a1
18-
caps.latest.revision: 6
19-
author: "corob-msft"
20-
ms.author: "corob"
21-
manager: "ghogen"
22-
translation.priority.ht:
23-
- "cs-cz"
24-
- "de-de"
25-
- "es-es"
26-
- "fr-fr"
27-
- "it-it"
28-
- "ja-jp"
29-
- "ko-kr"
30-
- "pl-pl"
31-
- "pt-br"
32-
- "ru-ru"
33-
- "tr-tr"
34-
- "zh-cn"
35-
- "zh-tw"
36-
---
37-
# Consistency Rules for Per-File Use of Precompiled Headers
38-
The [/Yu](../../build/reference/yu-use-precompiled-header-file.md) compiler option lets you specify which precompiled header (PCH) file to use.
39-
40-
When you use a PCH, the compiler assumes the same compilation environment — using consistent compiler options, pragmas, and so on — that was in effect when you created the PCH, unless you specify otherwise. If the compiler detects an inconsistency, it issues a warning and identifies the inconsistency where possible. Such warnings do not necessarily indicate a problem with the PCH; they simply warn you of possible conflicts. Consistency requirements for PCHs are described in the following sections.
41-
42-
## Compiler Option Consistency
43-
The following compiler options can trigger an inconsistency warning when using a PCH:
44-
45-
- Macros created using the Preprocessor (/D) option must be the same between the compilation that created the PCH and the current compilation. The state of defined constants is not checked, but unpredictable results can occur if these change.
46-
47-
- PCHs do not work with the /E and /EP options.
48-
49-
- PCHs must be created using either the Generate Browse Info (/FR) option or the Exclude Local Variables (/Fr) option before subsequent compilations that use the PCH can use these options.
50-
51-
## C 7.0-Compatible (/Z7)
52-
If this option is in effect when the PCH is created, subsequent compilations that use the PCH can use the debugging information.
53-
54-
If the C 7.0-Compatible (/Z7) option is not in effect when the PCH is created, subsequent compilations that use the PCH and /Z7 trigger a warning. The debugging information is placed in the current .obj file, and local symbols defined in the PCH are not available to the debugger.
55-
56-
## Include Path Consistency
57-
A PCH does not contain information about the include path that was in effect when it was created. When you use a .pch file, the compiler always uses the include path specified in the current compilation.
58-
59-
## Source File Consistency
60-
When you specify the Use Precompiled Header File (/Yu) option, the compiler ignores all preprocessor directives (including pragmas) that appear in the source code that will be precompiled. The compilation specified by such preprocessor directives must be the same as the compilation used for the Create Precompiled Header File (/Yc) option.
61-
62-
## Pragma Consistency
63-
Pragmas processed during the creation of a PCH usually affect the file with which the PCH is subsequently used. The comment and message pragmas do not affect the remainder of the compilation.
64-
65-
The following pragmas are retained as part of a PCH, and affect the remainder of a compilation that uses the PCH.
66-
67-
||||
68-
|-|-|-|
69-
|alloc_text|include_alias|pack|
70-
|auto_inline|init_seg|pointers_to_members|
71-
|check_stack|inline_depth|setlocale|
72-
|code_seg|inline_recursion|vtordisp|
73-
|data_seg|intrinsic|warning|
74-
|function|optimize||
75-
76-
## See Also
77-
[Precompiled Header Consistency Rules](../../build/reference/precompiled-header-consistency-rules.md)
78-
[/Yu (Use Precompiled Header File)](../../build/reference/yu-use-precompiled-header-file.md)
79-
[Compiler Options](../../build/reference/compiler-options.md)
2+
redirect_url: /cpp/build/reference/creating-precompiled-header-files#consistency-rules-for-per-file-use-of-precompiled-headers
3+
---
Lines changed: 2 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,3 @@
11
---
2-
title: "Consistency Rules for -Yc and -Yu | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "11/04/2016"
5-
ms.reviewer: ""
6-
ms.suite: ""
7-
ms.technology:
8-
- "cpp-tools"
9-
ms.tgt_pltfrm: ""
10-
ms.topic: "article"
11-
f1_keywords:
12-
- "/yc"
13-
- "/yu"
14-
dev_langs:
15-
- "C++"
16-
helpviewer_keywords:
17-
- "Yu compiler option [C++]"
18-
- "/Yu compiler option [C++]"
19-
- "-Yu compiler option [C++]"
20-
- "-Yc compiler option [C++]"
21-
- "/Yc compiler option [C++]"
22-
- "Yc compiler option [C++]"
23-
ms.assetid: 9dfb0e32-ec9b-4a36-9355-27a0e5fba512
24-
caps.latest.revision: 6
25-
author: "corob-msft"
26-
ms.author: "corob"
27-
manager: "ghogen"
28-
translation.priority.ht:
29-
- "cs-cz"
30-
- "de-de"
31-
- "es-es"
32-
- "fr-fr"
33-
- "it-it"
34-
- "ja-jp"
35-
- "ko-kr"
36-
- "pl-pl"
37-
- "pt-br"
38-
- "ru-ru"
39-
- "tr-tr"
40-
- "zh-cn"
41-
- "zh-tw"
42-
---
43-
# Consistency Rules for /Yc and /Yu
44-
When you use a precompiled header created using /Yc or /Yu, the compiler compares the current compilation environment to the one that existed when you created the .pch file. Be sure to specify an environment consistent with the previous one (using consistent compiler options, pragmas, and so on) for the current compilation. If the compiler detects an inconsistency, it issues a warning and identifies the inconsistency where possible. Such warnings don't necessarily indicate a problem with the .pch file; they simply warn you of possible conflicts. The following sections explain the consistency requirements for precompiled headers.
45-
46-
## Compiler Option Consistency
47-
The following table lists compiler options that might trigger an inconsistency warning when using a precompiled header.
48-
49-
|Option|Name|Rule|
50-
|------------|----------|----------|
51-
|/D|Define constants and macros|Must be the same between the compilation that created the precompiled header and the current compilation. The state of defined constants is not checked, but unpredictable results can occur if your files depend on the values of the changed constants.|
52-
|/E or /EP|Copy preprocessor output to standard output|Precompiled headers do not work with the /E or /EP option.|
53-
|/Fr or /FR|Generate Microsoft Source Browser information|For the /Fr and /FR options to be valid with the /Yu option, they must also have been in effect when the precompiled header was created. Subsequent compilations that use the precompiled header also generate Source Browser information. Browser information is placed in a single .sbr file and is referenced by other files in the same manner as CodeView information. You cannot override the placement of Source Browser information.|
54-
|/GA, /GD, /GE, /Gw, or /GW|Windows protocol options|Must be the same between the compilation that created the precompiled header and the current compilation. If these options differ, a warning message results.|
55-
|/Zi|Generate complete debugging information|If this option is in effect when the precompiled header is created, subsequent compilations that use the precompilation can use that debugging information. If /Zi is not in effect when the precompiled header is created, subsequent compilations that use the precompilation and the /Zi option trigger a warning. The debugging information is placed in the current object file, and local symbols defined in the precompiled header are not available to the debugger.|
56-
57-
> [!NOTE]
58-
> The precompiled header facility is intended for use only with a file with C and C++ source files.
59-
60-
## Include Path Consistency
61-
A precompiled header created with /Yc does not contain information about the include path that was in effect when you created the .pch file. When you use a .pch file, the compiler always uses the include path specified in the current compilation.
62-
63-
## Source File Consistency
64-
When you use a precompiled header, the compiler ignores all preprocessor directives (including pragmas) that appear before the hdrstop pragma. The compilation specified by such preprocessor directives must be the same as the compilation used to create the precompiled header file.
65-
66-
## Pragma Consistency
67-
Pragmas processed during the compilation of a precompiled header usually affect the file in which the precompiled header is subsequently used. The following pragmas affect only the code within the .pch file; they do not affect code that subsequently uses the .pch file:
68-
69-
||||
70-
|-|-|-|
71-
|Comment|page|subtitle|
72-
|Linesize|pagesize|Title|
73-
|Message|skip||
74-
75-
The following pragmas are retained as part of a precompiled header, and affect the remainder of a compilation that uses the precompiled header:
76-
77-
||||
78-
|-|-|-|
79-
|alloc_text|function|optimize|
80-
|auto_inline|inline_depth|Pack|
81-
|check_pointer|inline_recursion|same_seg|
82-
|check_stack|intrinsic|warning|
83-
|code_seg|loop_opt||
84-
|data_seg|native_caller||
85-
86-
## See Also
87-
[Precompiled Header Consistency Rules](../../build/reference/precompiled-header-consistency-rules.md)
88-
[/Yc (Create Precompiled Header File)](../../build/reference/yc-create-precompiled-header-file.md)
89-
[/Yu (Use Precompiled Header File)](../../build/reference/yu-use-precompiled-header-file.md)
2+
redirect_url: /cpp/build/reference/creating-precompiled-header-files#consistency-rules-for-yc-and-yu
3+
---

0 commit comments

Comments
 (0)