8221824: Build failure with MSVS 2013 after JDK-8218418
authorshade
Tue, 02 Apr 2019 17:10:09 +0200
changeset 54381 c47660e8f5b6
parent 54380 e297c7bb6469
child 54382 61616f509ef8
8221824: Build failure with MSVS 2013 after JDK-8218418 Reviewed-by: stuefe, alanb
src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c
--- 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