OSDN Git Service

Merging r367084:
authorHans Wennborg <hans@hanshq.net>
Wed, 14 Aug 2019 13:14:17 +0000 (13:14 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 14 Aug 2019 13:14:17 +0000 (13:14 +0000)
------------------------------------------------------------------------
r367084 | kongyi | 2019-07-26 07:17:14 +0200 (Fri, 26 Jul 2019) | 6 lines

Fix macOS build after r358716

COPYFILE_CLONE is only defined on newer macOS versions, using it without
check breaks build on systems running legacy OS and toolchain.

Differential Revision: https://reviews.llvm.org/D65317
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_90@368848 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Unix/Path.inc

index e80880c..27c8a1b 100644 (file)
@@ -1200,7 +1200,7 @@ namespace fs {
 /// implementation.
 std::error_code copy_file(const Twine &From, const Twine &To) {
   uint32_t Flag = COPYFILE_DATA;
-#if __has_builtin(__builtin_available)
+#if __has_builtin(__builtin_available) && defined(COPYFILE_CLONE)
   if (__builtin_available(macos 10.12, *)) {
     bool IsSymlink;
     if (std::error_code Error = is_symlink_file(From, IsSymlink))