RFR: 8293088: Fix compilation with the new Visual Studio preprocessor

Daniel Jeliński djelinski at openjdk.org
Mon Sep 5 07:25:28 UTC 2022


On Tue, 30 Aug 2022 12:08:09 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> Fix compilation with Zc:preprocessor enabled. 
> 
> The flag itself will be enabled in [JDK-8247283](https://bugs.openjdk.org/browse/JDK-8247283); I enabled the flag using instructions found in Magnus's comment on that issue.
> 
> Windows 10 SDK version 2104 (10.0.20348.0) is required for successful compilation. Compilation fails with a warning (treated as error by default) with older versions of Windows 10 SDK.
> 
> I verified that the compilation completes successfully with this patch, both in debug and in release mode, both with and without Zc:preprocessor.

I verified the preprocessor output on `D3DResourceManager.cpp` file, which uses 3 of the 4 changed macros in `D3DPipeline.h` (`RETURN_STATUS_IF_EXP_FAILED` is not used anywhere). The generated files have only cosmetic differences - `##` removes whitespace between the concatenated string literals, and without `##` the whitespace is preserved. This whitespace is ignored by the compiler.

-------------

PR: https://git.openjdk.org/jdk/pull/10080



More information about the security-dev mailing list