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/clang-support-msbuild.md
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,16 +15,18 @@ Clang support for both CMake and MSBuild projects is available in Visual Studio
15
15
16
16
::: moniker range="msvc-160"
17
17
18
-
You can use Visual Studio 2019 version 16.2 with Clang to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
18
+
You can use Visual Studio 2019 version 16.2 and later with Clang to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
19
19
20
20
## Install
21
21
22
22
For best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose the **C++ Clang-cl for v142 build tools.** optional component.
23
23
24
-
The Microsoft C++ Standard Library currently requires at least Clang 8.0.0. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library.
24
+
The Microsoft C++ Standard Library requires at least Clang 8.0.0.
25
25
26
26

27
27
28
+
Later versions of Visual Studio provide newer versions of the Clang toolset. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library. For example, Visual Studio 2019 version 16.9 includes Clang v11.
29
+
28
30
## Configure a Windows project to use Clang tools
29
31
30
32
To configure a Visual Studio project to use Clang, right-click on the project node in **Solution Explorer** and choose **Properties**. Typically, you should first choose **All configurations** at the top of the dialog. Then, under **General** > **Platform Toolset**, choose **LLVM (clang-cl)** and then **OK**.
@@ -116,6 +115,8 @@ The **`"a"`** mode doesn't remove the EOF marker before appending to the file. A
116
115
117
116
When the **`"r+"`**, **`"w+"`**, or **`"a+"`** access type is specified, both reading and writing are allowed. (The file is said to be open for "update".) However, when you switch from reading to writing, the input operation must come across an EOF marker. If there's no EOF marker, you must use an intervening call to a file-positioning function. The file-positioning functions are **`fsetpos`**, [`fseek`](fseek-fseeki64.md), and [`rewind`](rewind.md). When you switch from writing to reading, you must use an intervening call to either **`fflush`** or to a file-positioning function.
118
117
118
+
Starting in C11, you can append **`"x"`** to **`"w"`** or **`"w+"`** to cause the function fail if the file exists, instead of overwriting it.
119
+
119
120
In addition to the values above, the following characters can be included in *`mode`* to specify the translation mode for newline characters:
120
121
121
122
|*`mode`* modifier|Translation mode|
@@ -140,7 +141,7 @@ For more information about using text and binary modes in Unicode and multibyte
140
141
|**`R`**| Specifies that caching is optimized for, but not restricted to, random access from disk. |
141
142
|**`t`**| Specifies a file as temporary. If possible, it isn't flushed to disk. |
142
143
|**`D`**| Specifies a file as temporary. It's deleted when the last file pointer is closed. |
143
-
|**`ccs=**`_encoding_| Specifies the encoded character set to use (one of **`UTF-8`**, **`UTF-16LE`**, or **`UNICODE`**) for this file. Leave unspecified if you want ANSI encoding. |
144
+
|**`ccs=`**_encoding_| Specifies the encoded character set to use (one of **`UTF-8`**, **`UTF-16LE`**, or **`UNICODE`**) for this file. Leave unspecified if you want ANSI encoding. |
144
145
145
146
Valid characters for the *`mode`* string used in **`fopen_s`** and [`_fdopen`](fdopen-wfdopen.md) correspond to *`oflag`* arguments used in [`_open`](open-wopen.md) and [`_sopen`](sopen-wsopen.md), as follows.
146
147
@@ -164,7 +165,7 @@ Valid characters for the *`mode`* string used in **`fopen_s`** and [`_fdopen`](f
164
165
|**`ccs=UTF-8`**|**`_O_UTF8`**|
165
166
|**`ccs=UTF-16LE`**|**`_O_UTF16`**|
166
167
167
-
If you are using **`rb`** mode, memory mapped Win32 files might also be an option if you don't need to port your code, you expect to read much of the file, or you don't care about network performance.
168
+
If you're using **`rb`** mode, memory mapped Win32 files might also be an option if you don't need to port your code, you expect to read much of the file, or you don't care about network performance.
168
169
169
170
## Requirements
170
171
@@ -173,13 +174,13 @@ If you are using **`rb`** mode, memory mapped Win32 files might also be an optio
173
174
|**`fopen_s`**|`<stdio.h>`|
174
175
|**`_wfopen_s`**|`<stdio.h>` or `<wchar.h>`|
175
176
176
-
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
177
+
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
177
178
178
179
## Libraries
179
180
180
181
All versions of the [C run-time libraries](../../c-runtime-library/crt-library-features.md).
181
182
182
-
The **`c`**, **`n`**, and **`t`***`mode`* options are Microsoft extensions for **`fopen_s`** and [`_fdopen`](fdopen-wfdopen.md) and shouldn't be used where ANSI portability is desired.
183
+
The **`c`**, **`n`**, and **`t`***`mode`* options are Microsoft extensions for **`fopen_s`** and [`_fdopen`](fdopen-wfdopen.md) and shouldn't be used where you want ANSI portability.
Each of these functions returns a nonnegative value if it is successful. On an error, **fputs** and **fputws** return **EOF**. If *str* or *stream* is a null pointer, these functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **errno** to **EINVAL** and then **fputs** returns **EOF**, and **fputws** returns **WEOF**.
39
+
Each of these functions returns a nonnegative value if it is successful. On an error, **`fputs`** and **`fputws`** return **`EOF`**. If *`str`* or *`stream`* is a null pointer, these functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **`errno`** to **`EINVAL`** and then return **`EOF`**.
41
40
42
-
See [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md) for more information on these, and other, error codes.
41
+
For more information on error codes, see [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md).
43
42
44
43
## Remarks
45
44
46
-
Each of these functions copies *str* to the output *stream* at the current position. **fputws** copies the wide-character argument *str* to *stream* as a multibyte-character string or a wide-character string according to whether *stream* is opened in text mode or binary mode, respectively. Neither function copies the terminating null character.
45
+
Each of these functions copies *`str`* to the output *`stream`* at the current position. **`fputws`** copies the wide-character argument *`str`* to *`stream`* as a multibyte-character string or a wide-character string according to whether *`stream`* is opened in text mode or binary mode, respectively. Neither function copies the terminating null character.
47
46
48
-
The two functions behave identically if the stream is opened in ANSI mode. **fputs**does not currently support output into a UNICODE stream.
47
+
The two functions behave identically if the stream is opened in ANSI mode. **`fputs`**doesn't currently support output into a UNICODE stream.
49
48
50
-
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
49
+
By default, this function's global state is scoped to the application. To change it, see [Global state in the CRT](../global-state.md).
51
50
52
-
### Generic-Text Routine Mappings
51
+
### Generic-text routine mappings
53
52
54
53
|TCHAR.H routine|_UNICODE & _MBCS not defined|_MBCS defined|_UNICODE defined|
The console is not supported in Universal Windows Platform (UWP) apps. The standard stream handles that are associated with the console—**stdin**, **stdout**, and **stderr**—must be redirected before C run-time functions can use them in UWP apps. For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
64
+
The console isn't supported in Universal Windows Platform (UWP) apps. The standard stream handles that are associated with the console—**`stdin`**, **`stdout`**, and **`stderr`**—must be redirected before C runtime functions can use them in UWP apps. For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
0 commit comments