8129535: java_props_md.c should compile on VS 2010
Summary: Visual Studio 2010 does not allow declarations in the middle of blocks; only at the beginning
Reviewed-by: alanb
--- a/jdk/src/java.base/windows/native/libjava/java_props_md.c Mon Jun 22 13:30:21 2015 -0700
+++ b/jdk/src/java.base/windows/native/libjava/java_props_md.c Tue Jun 23 09:21:25 2015 -0400
@@ -408,6 +408,8 @@
// Read the major and minor version number from kernel32.dll
VS_FIXEDFILEINFO *file_info;
WCHAR kernel32_path[MAX_PATH];
+ DWORD version_size;
+ LPTSTR version_info;
UINT len, ret;
// Get the full path to \Windows\System32\kernel32.dll and use that for
@@ -419,12 +421,12 @@
}
wcsncat(kernel32_path, L"\\kernel32.dll", MAX_PATH - ret);
- DWORD version_size = GetFileVersionInfoSizeW(kernel32_path, NULL);
+ version_size = GetFileVersionInfoSizeW(kernel32_path, NULL);
if (version_size == 0) {
break;
}
- LPTSTR version_info = (LPTSTR)malloc(version_size);
+ version_info = (LPTSTR)malloc(version_size);
if (version_info == NULL) {
break;
}