jdk/make/lib/Lib-jdk.attach.gmk
changeset 30670 9663e1b741df
parent 29931 64e274ed6567
child 31069 14be2fa211f6
--- a/jdk/make/lib/Lib-jdk.attach.gmk	Wed May 06 20:37:33 2015 +0200
+++ b/jdk/make/lib/Lib-jdk.attach.gmk	Thu May 07 11:01:37 2015 +0200
@@ -27,6 +27,12 @@
 
 ################################################################################
 
+ifeq ($(OPENJDK_TARGET_OS), windows)
+  # In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate
+  # a binary that is compatible with windows versions older than 7/2008R2.
+  # See MSDN documentation for GetProcessMemoryInfo for more information.
+  LIBATTACH_CFLAGS := -DPSAPI_VERSION=1
+endif
 
 $(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \
     LIBRARY := attach, \
@@ -35,7 +41,7 @@
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
         -I$(SUPPORT_OUTPUTDIR)/headers/jdk.attach \
-        $(LIBJAVA_HEADER_FLAGS), \
+        $(LIBJAVA_HEADER_FLAGS) $(LIBATTACH_CFLAGS), \
     CFLAGS_windows := /Gy, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \
     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \