[llvm-commits] [llvm] r73379 - /llvm/trunk/lib/System/Win32/Path.inc
    Chris Lattner 
    sabre at nondot.org
       
    Sun Jun 14 22:38:04 PDT 2009
    
    
  
Author: lattner
Date: Mon Jun 15 00:38:04 2009
New Revision: 73379
URL: http://llvm.org/viewvc/llvm-project?rev=73379&view=rev
Log:
"This patch implements the method with the GetModuleFileName function for windows."
Patch by Benjamin Kramer!
Modified:
    llvm/trunk/lib/System/Win32/Path.inc
Modified: llvm/trunk/lib/System/Win32/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Path.inc?rev=73379&r1=73378&r2=73379&view=diff
==============================================================================
--- llvm/trunk/lib/System/Win32/Path.inc (original)
+++ llvm/trunk/lib/System/Win32/Path.inc Mon Jun 15 00:38:04 2009
@@ -248,7 +248,9 @@
 /// GetMainExecutable - Return the path to the main executable, given the
 /// value of argv[0] from program startup.
 Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
-  return Path();
+  char pathname[MAX_PATH];
+  DWORD ret = ::GetModuleFileNameA(NULL, pathname, MAX_PATH);
+  return ret != MAX_PATH ? Path(pathname) : Path();
 }
 
 
    
    
More information about the llvm-commits
mailing list