_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
This commit is contained in:
David Fang 2014-02-12 21:02:12 +00:00
parent 4c1ea6b115
commit 17159cb158

View File

@ -508,8 +508,9 @@ bool is_separator(char value) {
void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &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 <unistd.h> on darwin >= 9
int ConfName = erasedOnReboot? _CS_DARWIN_USER_TEMP_DIR
: _CS_DARWIN_USER_CACHE_DIR;
size_t ConfLen = confstr(ConfName, 0, 0);