summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-26 05:25:44 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-26 05:25:44 +0000
commit4601c462a7d40d6479d7ad7a1c4b930b5d65b086 (patch)
tree7a3b5b0819247ee5a004aa42a863509661e430c9 /llvm/lib/Support
parent4b304b0abf5807138b4d7320f1c616ea98555f0a (diff)
downloadbcm5719-llvm-4601c462a7d40d6479d7ad7a1c4b930b5d65b086.tar.gz
bcm5719-llvm-4601c462a7d40d6479d7ad7a1c4b930b5d65b086.zip
Fix the build when __APPLE__ is defined.
llvm-svn: 184917
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Unix/PathV2.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/PathV2.inc b/llvm/lib/Support/Unix/PathV2.inc
index c7a1c92d46d..588f9e8dd1a 100644
--- a/llvm/lib/Support/Unix/PathV2.inc
+++ b/llvm/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__)
OpenPOWER on IntegriCloud