summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-05-07 17:10:27 +0000
committerAdrian Prantl <aprantl@apple.com>2019-05-07 17:10:27 +0000
commitccdefb24adaad85d4afc75ab39f7cfb32d3ed0f8 (patch)
treea7d52a4fd0c4dcc1d7c2327438a95cf36a891a78 /llvm/lib
parent0ed545ebb3f6fece491671904b680394a318c95f (diff)
downloadbcm5719-llvm-ccdefb24adaad85d4afc75ab39f7cfb32d3ed0f8.tar.gz
bcm5719-llvm-ccdefb24adaad85d4afc75ab39f7cfb32d3ed0f8.zip
Guard __builtin_available() with __has_builtin to support older host compilers.
llvm-svn: 360174
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/Unix/Path.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index fa5115bfd65..fb14422ba33 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/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);
OpenPOWER on IntegriCloud