From 17159cb1588dd44d0cfc8a5f96da8be04be4c975 Mon Sep 17 00:00:00 2001 From: David Fang Date: Wed, 12 Feb 2014 21:02:12 +0000 Subject: [PATCH] _CS_DARWIN_USER macros available on darwin>=9. Thanks, Dave Odell! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201255 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Path.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp index 1872af55ed6..1e59c7adb5b 100644 --- a/lib/Support/Path.cpp +++ b/lib/Support/Path.cpp @@ -508,8 +508,9 @@ bool is_separator(char value) { void system_temp_directory(bool erasedOnReboot, SmallVectorImpl &result) { result.clear(); -#ifdef __APPLE__ +#if defined(_CS_DARWIN_USER_TEMP_DIR) && defined(_CS_DARWIN_USER_CACHE_DIR) // On Darwin, use DARWIN_USER_TEMP_DIR or DARWIN_USER_CACHE_DIR. + // macros defined in on darwin >= 9 int ConfName = erasedOnReboot? _CS_DARWIN_USER_TEMP_DIR : _CS_DARWIN_USER_CACHE_DIR; size_t ConfLen = confstr(ConfName, 0, 0);