Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8199736

Define WIN32_LEAN_AND_MEAN before including windows.h

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b10
    • OS:
      windows

      Description

      To reduce the amount of headers included by windows.h, it's possible to define WIN32_LEAN_AND_MEAN before including it [1]. This also makes it possible to access definitions in winsock2.h which otherwise would conflict with the older winsock.h that windows.h pulls in.

      Quick testing didn't see any significant build time improvements (15 seconds faster building hotspot on my machine, the pch file shrinks from 120mb to 112mb) but access to winsock2.h would be useful for JFR.

      [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx#faster_builds_with_smaller_header_files

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rwestberg Robin Westberg
                Reporter:
                rwestberg Robin Westberg
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: