diff options
author | Chris Lattner <sabre@nondot.org> | 2009-06-15 05:38:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-06-15 05:38:04 +0000 |
commit | 7038cd5247513f0ed2db604ccf31beadb36e38f6 (patch) | |
tree | b7c39775ab787c0ffe215eaa007ce9e9a2068221 | |
parent | 6ed7d5964eade6c3f0308a1ef1df98641ef1e526 (diff) | |
download | bcm5719-llvm-7038cd5247513f0ed2db604ccf31beadb36e38f6.tar.gz bcm5719-llvm-7038cd5247513f0ed2db604ccf31beadb36e38f6.zip |
"This patch implements the method with the GetModuleFileName function for windows."
Patch by Benjamin Kramer!
llvm-svn: 73379
-rw-r--r-- | llvm/lib/System/Win32/Path.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/System/Win32/Path.inc b/llvm/lib/System/Win32/Path.inc index 62da3a34c45..683c94bba44 100644 --- a/llvm/lib/System/Win32/Path.inc +++ b/llvm/lib/System/Win32/Path.inc @@ -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(); } |