changeset 54381:c47660e8f5b6

8221824: Build failure with MSVS 2013 after JDK-8218418 Reviewed-by: stuefe, alanb
author shade
date Tue, 02 Apr 2019 17:10:09 +0200
parents e297c7bb6469
children 61616f509ef8
files src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c	Tue Oct 24 10:41:45 2017 +0200
+++ b/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c	Tue Apr 02 17:10:09 2019 +0200
@@ -1065,8 +1065,11 @@
 
     // Allow creation of symbolic links when the process is not elevated.
     // Developer Mode must be enabled for this option to function, otherwise
-    // it will be ignored.
-    DWORD dwFlags = (DWORD)flags | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
+    // it will be ignored. Check that symbol is available in current build SDK.
+    DWORD dwFlags = (DWORD)flags;
+#ifdef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
+    dwFlags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
+#endif
 
     // On Windows 64-bit this appears to succeed even when there are
     // insufficient privileges