8199736: Define WIN32_LEAN_AND_MEAN before including windows.h
authorrwestberg
Mon, 09 Apr 2018 10:09:38 +0200
changeset 49726 4ae63fcabe2e
parent 49725 e740e1a38c96
child 49727 2bbd5117d91a
8199736: Define WIN32_LEAN_AND_MEAN before including windows.h Reviewed-by: erikj, ihse, kbarrett, dholmes
make/autoconf/flags-cflags.m4
src/hotspot/os/windows/os_windows.cpp
src/hotspot/share/interpreter/bytecodes.cpp
src/hotspot/share/utilities/ostream.cpp
--- a/make/autoconf/flags-cflags.m4	Mon Apr 09 20:36:04 2018 -0400
+++ b/make/autoconf/flags-cflags.m4	Mon Apr 09 10:09:38 2018 +0200
@@ -453,7 +453,7 @@
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \
         -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
-    ALWAYS_DEFINES_JVM="-DNOMINMAX"
+    ALWAYS_DEFINES_JVM="-DNOMINMAX -DWIN32_LEAN_AND_MEAN"
   fi
 
   ###############################################################################
--- a/src/hotspot/os/windows/os_windows.cpp	Mon Apr 09 20:36:04 2018 -0400
+++ b/src/hotspot/os/windows/os_windows.cpp	Mon Apr 09 10:09:38 2018 +0200
@@ -99,6 +99,8 @@
 // for enumerating dll libraries
 #include <vdmdbg.h>
 #include <psapi.h>
+#include <mmsystem.h>
+#include <winsock2.h>
 
 // for timer info max values which include all bits
 #define ALL_64_BITS CONST64(-1)
--- a/src/hotspot/share/interpreter/bytecodes.cpp	Mon Apr 09 20:36:04 2018 -0400
+++ b/src/hotspot/share/interpreter/bytecodes.cpp	Mon Apr 09 10:09:38 2018 +0200
@@ -45,7 +45,7 @@
 s_char          Bytecodes::_depth         [Bytecodes::number_of_codes];
 u_char          Bytecodes::_lengths       [Bytecodes::number_of_codes];
 Bytecodes::Code Bytecodes::_java_code     [Bytecodes::number_of_codes];
-u_short         Bytecodes::_flags         [(1<<BitsPerByte)*2];
+unsigned short  Bytecodes::_flags         [(1<<BitsPerByte)*2];
 
 #ifdef ASSERT
 bool Bytecodes::check_method(const Method* method, address bcp) {
--- a/src/hotspot/share/utilities/ostream.cpp	Mon Apr 09 20:36:04 2018 -0400
+++ b/src/hotspot/share/utilities/ostream.cpp	Mon Apr 09 10:09:38 2018 +0200
@@ -1027,6 +1027,8 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#elif defined(_WINDOWS)
+#include <winsock2.h>
 #endif
 
 // Network access