mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-08 18:30:04 +00:00
Checking if TARGET_OS_IPHONE is defined isn't good enough for 10.7 and earlier.
Older versions of the TargetConditionals header always defined TARGET_OS_IPHONE to something (0 or 1), so we need to test not only for the existence but also if it is 1. This resolves PR22631. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229904 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f45c1a4d12
commit
cbccd8ddf5
@ -42,10 +42,18 @@
|
|||||||
#define _RESTRICT_KYWD
|
#define _RESTRICT_KYWD
|
||||||
#endif
|
#endif
|
||||||
#include <spawn.h>
|
#include <spawn.h>
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#include <TargetConditionals.h>
|
#include <TargetConditionals.h>
|
||||||
#endif
|
#endif
|
||||||
#if !defined(__APPLE__) || defined(TARGET_OS_IPHONE)
|
|
||||||
|
#if defined(__APPLE__) && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
|
||||||
|
#define USE_NSGETENVIRON 1
|
||||||
|
#else
|
||||||
|
#define USE_NSGETENVIRON 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !USE_NSGETENVIRON
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
#else
|
#else
|
||||||
#include <crt_externs.h> // _NSGetEnviron
|
#include <crt_externs.h> // _NSGetEnviron
|
||||||
@ -220,7 +228,7 @@ static bool Execute(ProcessInfo &PI, StringRef Program, const char **args,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!envp)
|
if (!envp)
|
||||||
#if !defined(__APPLE__) || defined(TARGET_OS_IPHONE)
|
#if !USE_NSGETENVIRON
|
||||||
envp = const_cast<const char **>(environ);
|
envp = const_cast<const char **>(environ);
|
||||||
#else
|
#else
|
||||||
// environ is missing in dylibs.
|
// environ is missing in dylibs.
|
||||||
|
Loading…
Reference in New Issue
Block a user