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

Define WIN32_LEAN_AND_MEAN before including windows.h

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • 11
    • hotspot
    • None
    • b10
    • windows

      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

            rwestberg Robin Westberg (Inactive)
            rwestberg Robin Westberg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: