From c87f55b3a44eccf5e481958f0600cf4372560645 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 7 May 2019 17:10:27 +0000 Subject: [PATCH] Guard __builtin_available() with __has_builtin to support older host compilers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360174 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Unix/Path.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index fa5115bfd65..fb14422ba33 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -1137,6 +1137,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 (__builtin_available(macos 10.12, *)) { bool IsSymlink; if (std::error_code Error = is_symlink_file(From, IsSymlink)) @@ -1146,7 +1147,7 @@ std::error_code copy_file(const Twine &From, const Twine &To) { if (!IsSymlink && !exists(To)) Flag = COPYFILE_CLONE; } - +#endif int Status = copyfile(From.str().c_str(), To.str().c_str(), /* State */ NULL, Flag); -- 2.40.0