"This patch implements the method with the GetModuleFileName function for windows."

Patch by Benjamin Kramer!

llvm-svn: 73379
This commit is contained in:
Chris Lattner 2009-06-15 05:38:04 +00:00
parent 6ed7d5964e
commit 7038cd5247
1 changed files with 3 additions and 1 deletions

View File

@ -248,7 +248,9 @@ Path::GetCurrentDirectory() {
/// 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();
}