[llvm] r184917 - Fix the build when __APPLE__ is defined.

Rafael Espindola rafael.espindola at gmail.com
Tue Jun 25 22:25:44 PDT 2013


Author: rafael
Date: Wed Jun 26 00:25:44 2013
New Revision: 184917

URL: http://llvm.org/viewvc/llvm-project?rev=184917&view=rev
Log:
Fix the build when __APPLE__ is defined.

Modified:
    llvm/trunk/lib/Support/Unix/PathV2.inc

Modified: llvm/trunk/lib/Support/Unix/PathV2.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/PathV2.inc?rev=184917&r1=184916&r2=184917&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/PathV2.inc (original)
+++ llvm/trunk/lib/Support/Unix/PathV2.inc Wed Jun 26 00:25:44 2013
@@ -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
   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__)





More information about the llvm-commits mailing list