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/cl-environment-variables.md
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,56 +17,59 @@ ms.author: "corob"
17
17
manager: "ghogen"
18
18
---
19
19
# CL Environment Variables
20
+
20
21
The CL tool uses the following environment variables:
21
22
22
-
-CL and _CL\_, if defined. The CL tool prepends the options and arguments defined in the CL environment variable to the command line arguments, and appends the options and arguments defined in _CL\_, before processing.
23
+
- CL and \_CL\_, if defined. The CL tool inserts the options and arguments defined in the CL environment variable at the beginning of the command line arguments, and adds the options and arguments defined in \_CL\_ to the end of the command line arguments, before processing.
23
24
24
-
-INCLUDE, which must point to the \include subdirectory of your Visual C++ installation.
25
+
- INCLUDE, which must point to the \include subdirectory of your Visual C++ installation.
25
26
26
-
-LIBPATH, which specifies directories to search for metadata files referenced with [#using](../../preprocessor/hash-using-directive-cpp.md). See `#using` for more information on LIBPATH.
27
+
- LIBPATH, which specifies directories to search for metadata files referenced by a `#using` directive. See [#using](../../preprocessor/hash-using-directive-cpp.md) for more information on LIBPATH.
27
28
28
-
You can set the CL or _CL\_ environment variable using the following syntax:
29
+
You can set the CL or \_CL\_ environment variables using the following syntax:
29
30
30
31
```
31
32
SET CL=[ [option] ... [file] ...] [/link link-opt ...]
32
33
SET _CL_=[ [option] ... [file] ...] [/link link-opt ...]
33
34
```
34
35
35
-
For details on the arguments to the CL and _CL\_ environment variables, see [Compiler Command-Line Syntax](../../build/reference/compiler-command-line-syntax.md).
36
+
For details on the arguments to the CL and \_CL\_ environment variables, see [Compiler Command-Line Syntax](../../build/reference/compiler-command-line-syntax.md).
36
37
37
-
You can use these environment variables to define the files and options you use most often and use the command line to define specific files and options for specific purposes. The CL and _CL\_ environment variables are limited to 1024 characters (the command-line input limit).
38
+
You can use these environment variables to define the files and options you use most often and use the command line to define specific files and options for specific purposes. The CL and \_CL\_ environment variables are limited to 1024 characters (the command-line input limit).
38
39
39
-
You cannot use the /D option to define a symbol that uses an equal sign (=). You can substitute the number sign (#) for an equal sign. In this way, you can use the CL or _CL_environment variables to define preprocessor constants with explicit values—for example, `/DDEBUG#1` to define `DEBUG=1`.
40
+
You cannot use the /D option to define a symbol that uses an equal sign (=). You can substitute the number sign (#) for an equal sign. In this way, you can use the CL or \_CL\_ environment variables to define preprocessor constants with explicit values; for example, `/DDEBUG#1` to define `DEBUG=1`.
40
41
41
-
For related information, see [Set Environment Variables](../../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
42
+
For related information, see [Set Environment Variables](../../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
42
43
43
-
## Examples
44
-
The following is an example of setting the CL environment variable:
44
+
## Examples
45
+
46
+
The following is an example of setting the CL environment variable:
45
47
46
48
```
47
49
SET CL=/Zp2 /Ox /I\INCLUDE\MYINCLS \LIB\BINMODE.OBJ
48
50
```
49
51
50
-
When this environment variable is set, if you enter `CL INPUT.C` at the command line, this is the effective command:
52
+
When this environment variable is set, if you enter `CL INPUT.C` at the command line, this is the effective command:
The following example causes a plain CL command to compile the source files FILE1.c and FILE2.c, and then link the object files FILE1.obj, FILE2.obj, and FILE3.obj:
58
+
The following example causes a plain CL command to compile the source files FILE1.c and FILE2.c, and then link the object files FILE1.obj, FILE2.obj, and FILE3.obj:
57
59
58
60
```
59
61
SET CL=FILE1.C FILE2.C
60
62
SET _CL_=FILE3.OBJ
61
63
CL
62
64
```
63
65
64
-
This has the same effect as the following command line:
66
+
This has the same effect as the following command line:
Copy file name to clipboardExpand all lines: docs/build/reference/driver-windows-nt-kernel-mode-driver.md
+37-36Lines changed: 37 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,39 +17,40 @@ ms.author: "corob"
17
17
manager: "ghogen"
18
18
---
19
19
# /DRIVER (Windows NT Kernel Mode Driver)
20
-
```
21
-
/DRIVER[:UPONLY | :WDM]
22
-
```
23
-
24
-
## Remarks
25
-
Use the /DRIVER linker option to build a Windows NT kernel mode driver.
26
-
27
-
**/DRIVER:UPONLY** causes the linker to add the **IMAGE_FILE_UP_SYSTEM_ONLY** bit to the characteristics in the output header to specify that it is a uniprocessor (UP) driver. The operating system will refuse to load a UP driver on a multiprocessor (MP) system.
28
-
29
-
**/DRIVER:WDM** causes the linker to set the **IMAGE_DLLCHARACTERISTICS_WDM_DRIVER** bit in the optional header's DllCharacteristics field.
30
-
31
-
If **/DRIVER** is not specified, these bits are not set by the linker.
32
-
33
-
If **/DRIVER** is specified:
34
-
35
-
- /FIXED:NO is in effect ([/FIXED (Fixed Base Address)](../../build/reference/fixed-fixed-base-address.md)).
36
-
37
-
- The extension of the output file will be .sys. Use **/OUT** to change the default filename and extension ([/OUT (Output File Name)](../../build/reference/out-output-file-name.md)).
38
-
39
-
### To set this linker option in the Visual Studio development environment
40
-
41
-
1. Open the project's **Property Pages** dialog box. For details, see [Setting Visual C++ Project Properties](../../ide/working-with-project-properties.md).
42
-
43
-
2. Click the **Linker** folder.
44
-
45
-
3. Click the **System** property page.
46
-
47
-
4. Modify the **Driver** property.
48
-
49
-
### To set this linker option programmatically
50
-
51
-
1. See `P:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.driver`.
Use the **/DRIVER** linker option to build a Windows NT kernel mode driver.
26
+
27
+
**/DRIVER:UPONLY** causes the linker to add the **IMAGE_FILE_UP_SYSTEM_ONLY** bit to the characteristics in the output header to specify that it is a uniprocessor (UP) driver. The operating system will refuse to load a UP driver on a multiprocessor (MP) system.
28
+
29
+
**/DRIVER:WDM** causes the linker to set the **IMAGE_DLLCHARACTERISTICS_WDM_DRIVER** bit in the optional header's DllCharacteristics field.
30
+
31
+
If **/DRIVER** is not specified, these bits are not set by the linker.
32
+
33
+
If **/DRIVER** is specified:
34
+
35
+
-**/FIXED:NO** is in effect. For more information, see [/FIXED (Fixed Base Address)](../../build/reference/fixed-fixed-base-address.md).
36
+
37
+
- The extension of the output file is set to .sys. Use **/OUT** to change the default filename and extension. For more information, see [/OUT (Output File Name)](../../build/reference/out-output-file-name.md).
38
+
39
+
### To set this linker option in the Visual Studio development environment
40
+
41
+
1. Open the project's **Property Pages** dialog box. For details, see [Setting Visual C++ Project Properties](../../ide/working-with-project-properties.md).
42
+
43
+
2. Click the **Linker** folder.
44
+
45
+
3. Click the **System** property page.
46
+
47
+
4. Modify the **Driver** property.
48
+
49
+
### To set this linker option programmatically
50
+
51
+
1. See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.driver>.
Copy file name to clipboardExpand all lines: docs/build/reference/std-specify-language-standard-version.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,10 +50,12 @@ The **/std:c++17** option enables the full set of C++17 features implemented by
50
50
51
51
The **/std:c++latest** option enables the set of C++ language and library features implemented by Visual C++ to track the most recent Working Draft and defect updates of the C++ Standard. Use this switch to get the latest language features supported by the compiler. For a list of supported language and library features, see [What's New for Visual C++](../../what-s-new-for-visual-cpp-in-visual-studio.md). The **/std:c++latest** option does not enable features guarded by the **/experimental** switch.
52
52
53
+
The **/std** option in effect during a C++ compilation can be detected by use of the [\_MSVC\_LANG](../preprocessor/predefined-macros.md) preprocessor macro. For more information, see [Preprocessor Macros](../preprocessor/predefined-macros.md).
54
+
53
55
The **/std:c++14** and **/std:c++latest** options are available beginning in Visual C++ 2015 Update 3. The **/std:c++17** option is available beginning in Visual C++ 2017 Update Version 15.3.
54
56
55
-
>[!NOTE]
56
-
> Depending on the Visual C++ compiler version or update level, certain C++14 features may not be fully implemented or fully conformant when you specify the **/std:c++14** option. For example, the Visual C++ 2017 RTM compiler does not fully support C++14-conformant `constexpr`, expression SFINAE, or 2-phase name lookup. For an overview of C++ language conformance in Visual C++, see [Visual C++ Language Conformance](../../visual-cpp-language-conformance.md).
57
+
[!NOTE]
58
+
> Depending on the Visual C++ compiler version or update level, certain C++14 features may not be fully implemented or fully conformant when you specify the **/std:c++14** option. For example, the Visual C++ 2017 RTM compiler does not fully support C++14-conformant `constexpr`, expression SFINAE, or 2-phase name lookup. For an overview of C++ language conformance in Visual C++, see [Visual C++ Language Conformance](../../visual-cpp-language-conformance.md).
57
59
58
60
### To set this compiler option in the Visual Studio development environment
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/get-osfhandle.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "_get_osfhandle | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "11/04/2016"
4
+
ms.date: "09/11/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.technology: ["cpp-standard-libraries"]
@@ -20,6 +20,7 @@ ms.author: "corob"
20
20
manager: "ghogen"
21
21
---
22
22
# _get_osfhandle
23
+
23
24
Retrieves the operating-system file handle that is associated with the specified file descriptor.
24
25
25
26
## Syntax
@@ -30,15 +31,18 @@ intptr_t _get_osfhandle(
30
31
);
31
32
```
32
33
33
-
#### Parameters
34
-
`fd`
35
-
An existing file descriptor.
34
+
### Parameters
35
+
36
+
*fd*
37
+
An existing file descriptor.
36
38
37
-
## Return Value
38
-
An operating-system file handle if `fd` is valid. Otherwise, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function returns `INVALID_HANDLE_VALUE` (-1) and sets `errno` to `EBADF`, indicating an invalid file handle.
39
+
## Return Value
40
+
41
+
An operating-system file handle if *fd* is valid. Otherwise, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, this function returns `INVALID_HANDLE_VALUE` (-1) and sets `errno` to `EBADF`, indicating an invalid file handle.
39
42
40
-
## Remarks
41
-
To close a file opened with `_get_osfhandle`, call `_close`. The underlying handle is also closed by a call to `_close`, so it is not necessary to call the Win32 function `CloseHandle` on the original handle.
43
+
## Remarks
44
+
45
+
To close a file whose operating-system file handle is obtained by `_get_osfhandle`, call [\_close](../../c-runtime-library/reference/close.md) on the file descriptor *fd*. The underlying handle is also closed by a call to `_close`, so it is not necessary to call the Win32 function `CloseHandle` on the original handle.
42
46
43
47
## Requirements
44
48
@@ -48,9 +52,10 @@ intptr_t _get_osfhandle(
48
52
49
53
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md) in the Introduction.
Copy file name to clipboardExpand all lines: docs/porting/overview-of-potential-upgrade-issues-visual-cpp.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Over the years, the Visual C++ compiler has undergone many changes, along with c
35
35
36
36
For the CRT, mixing-and-matching was never supported, but it often just worked, at least until Visual Studio 2015 and the Universal CRT, because the API surface did not change much over time. The Universal CRT broke backwards compatibility so that in the future we can maintain backwards compatibility. In other words, we have no plans to introduce new, versioned Universal CRT binaries in the future. Instead, the existing Universal CRT is now updated in-place.
37
37
38
-
To provide partial link compatibility with object files (and libraries) compiled with older versions of the Microsoft C Runtime headers, we provide a library, legacy_stdio_definitions.lib, with Visual Studio 2015 and later. This library provides compatibility symbols for most of the functions and data exports that were removed from the Universal CRT. The set of compatibility symbols provided by legacy_stdio_definitions.lib is sufficient to satisfy most dependencies, including all of the dependencies in libraries included in the Windows SDK. However, there are some symbols that were removed from the Universal CRT for which it is not possible to provide compatibility symbols like this. These symbols include some functions (e.g., \__iob_func) and the data exports (e.g., \__imp\_\__iob, \__imp\_\__pctype, \__imp\_\__mb_cur_max).
38
+
To provide partial link compatibility with object files (and libraries) compiled with older versions of the Microsoft C Runtime headers, we provide a library, legacy_stdio_definitions.lib, with Visual Studio 2015 and later. This library provides compatibility symbols for most of the functions and data exports that were removed from the Universal CRT. The set of compatibility symbols provided by legacy_stdio_definitions.lib is sufficient to satisfy most dependencies, including all of the dependencies in libraries included in the Windows SDK. However, there are some symbols that were removed from the Universal CRT for which it is not possible to provide compatibility symbols like this. These symbols include some functions (e.g., \_\_iob\_func) and the data exports (e.g., \_\_imp\_\_\_iob, \_\_imp\_\_\_pctype, \_\_imp\_\_\_mb_cur_max).
39
39
40
40
If you have a static library that was built with an older version of the C Runtime headers, we recommend the following actions (in this order):
0 commit comments