[PATCH] D65317: Fix macOS build after r358716

Yi Kong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 21:59:22 PDT 2019


kongyi created this revision.
kongyi added reviewers: aprantl, JDevlieghere, davide.
Herald added subscribers: llvm-commits, kristina, hiraditya.
Herald added a project: LLVM.
kongyi added subscribers: pirama, srhines.

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


Repository:
  rL LLVM

https://reviews.llvm.org/D65317

Files:
  llvm/lib/Support/Unix/Path.inc


Index: llvm/lib/Support/Unix/Path.inc
===================================================================
--- llvm/lib/Support/Unix/Path.inc
+++ llvm/lib/Support/Unix/Path.inc
@@ -1198,7 +1198,7 @@
 /// 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))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65317.211877.patch
Type: text/x-patch
Size: 559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190726/24555f35/attachment.bin>


More information about the llvm-commits mailing list