From: Adrian Prantl Date: Tue, 7 May 2019 17:10:27 +0000 (+0000) Subject: Guard __builtin_available() with __has_builtin to support older host compilers. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c87f55b3a44eccf5e481958f0600cf4372560645;p=llvm 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 --- 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);