This is a retake on https://github.com/openjdk/jdk/pull/15096.
I tried to fix the remaining issues in that PR, but could not push them. In the end, it seemed easier to create a new branch in my own personal fork. The majority of the work in this PR has been done by @TheShermanTanker. I have stepped in and fixed the remaining comments, reverted some additional unneeded changed code, and also tried to minimize code duplication in `awt_PrintJob.cpp`. ------------- Commit messages: - 8307160: Fix AWT/2D/A11Y to support the permissive- flag on the Microsoft Visual C compiler Changes: https://git.openjdk.org/jdk/pull/18584/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=18584&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8307160 Stats: 428 lines in 12 files changed: 284 ins; 50 del; 94 mod Patch: https://git.openjdk.org/jdk/pull/18584.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/18584/head:pull/18584 PR: https://git.openjdk.org/jdk/pull/18584