From 1358034f7adf2c7efb7ef77a771c802a87e6879d Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Fri, 26 Jul 2019 05:17:14 +0000 Subject: [PATCH] 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/trunk@367084 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Path.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index 908f43ed5a9..5c2c061fb88 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -1203,7 +1203,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)) -- 2.40.0