# Check functions
#
CHECK_SYMBOL_EXISTS(CreateHardLinkA "windows.h" HAVE_CREATEHARDLINKA)
+CHECK_SYMBOL_EXISTS(CreateHardLinkW "windows.h" HAVE_CREATEHARDLINKW)
CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS)
CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN)
CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT)
/* Define to 1 if you have the `chroot' function. */
#cmakedefine HAVE_CHROOT 1
-/* Define to 1 if you have the `CreateSymbolicLink function. */
-#cmakedefine HAVE_CREATESYMBOLICLINK 1
+/* Define to 1 if you have the `CreateHardLinkA' function. */
+#cmakedefine HAVE_CREATEHARDLINKA 1
-/* Define to 1 if you have the `CreateHardLink function. */
-#cmakedefine HAVE_CREATEHARDLINK 1
+/* Define to 1 if you have the `CreateHardLinkW' function. */
+#cmakedefine HAVE_CREATEHARDLINKW 1
/* Define to 1 if you have the <ctype.h> header file. */
#cmakedefine HAVE_CTYPE_H 1
return (handle);
}
+#if HAVE_CREATEHARDLINKW
+/* Check that path1 and path2 can be hard-linked by each other.
+ * Both arguments must be made by permissive_name function.
+ */
static size_t
wequallen(const wchar_t *s1, const wchar_t *s2)
{
return (i);
}
-/* Check that path1 and path2 can be hard-linked by each other.
- * Both arguments must be made by permissive_name function.
- */
static int
canHardLinkW(const wchar_t *path1, const wchar_t *path2)
{
else
return (0);
}
+#endif
/* Make a link to src called dst. */
static int
retval = -1;
goto exit;
}
+#if HAVE_CREATEHARDLINKW
if (!sym && canHardLinkW(wsrc, wdst))
res = CreateHardLinkW(wdst, wsrc, NULL);
else
+#endif
res = CopyFileW(wsrc, wdst, FALSE);
} else {
/* wsrc does not exist; try src prepend it with the dirname of wdst */
retval = -1;
goto exit;
}
+#if HAVE_CREATEHARDLINKW
if (!sym && canHardLinkW(wnewsrc, wdst))
res = CreateHardLinkW(wdst, wnewsrc, NULL);
else
+#endif
res = CopyFileW(wnewsrc, wdst, FALSE);
free (wnewsrc);
}