diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-26 05:25:44 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-26 05:25:44 +0000 |
commit | b6df0bc95a7c8bee3fd43dea771e53a59cc1d597 (patch) | |
tree | 69c0e02922dd54a9bd53d68fcd5d01aef338f259 /lib/Support/Unix | |
parent | bdfe4399dba7370827146e44734b5a5456d223fa (diff) | |
download | external_llvm-b6df0bc95a7c8bee3fd43dea771e53a59cc1d597.zip external_llvm-b6df0bc95a7c8bee3fd43dea771e53a59cc1d597.tar.gz external_llvm-b6df0bc95a7c8bee3fd43dea771e53a59cc1d597.tar.bz2 |
Fix the build when __APPLE__ is defined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184917 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r-- | lib/Support/Unix/PathV2.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc index c7a1c92..588f9e8 100644 --- a/lib/Support/Unix/PathV2.inc +++ b/lib/Support/Unix/PathV2.inc @@ -50,6 +50,10 @@ #include <limits.h> #endif +#ifdef __APPLE__ +#include <mach-o/dyld.h> +#endif + // Both stdio.h and cstdio are included via different pathes and // stdcxx's cstdio doesn't include stdio.h, so it doesn't #undef the macros // either. @@ -177,7 +181,7 @@ std::string getMainExecutable(const char *argv0, void *MainAddr) { if (_NSGetExecutablePath(exe_path, &size) == 0) { char link_path[MAXPATHLEN]; if (realpath(exe_path, link_path)) - return Path(link_path); + return link_path; } #elif defined(__FreeBSD__) || defined (__NetBSD__) || defined(__Bitrig__) || \ defined(__OpenBSD__) || defined(__minix) || defined(__FreeBSD_kernel__) |